Commit f6325277 authored by Sven Rhinow's avatar Sven Rhinow

add ronance.php for update srl_css_file in binary-fieldtyp, get css-filepath from binaryfield

parent 6c623e08
......@@ -160,8 +160,16 @@ class ModuleSRLayer extends \Module
$jsOptions = implode(', ',$this->optionsArr);
//eigene CSS-Auszeichnungen aus CSS-Datei
if($this->srl_css_file) $GLOBALS['TL_CSS'][] = $this->srl_css_file;
else $GLOBALS['TL_CSS'][] = $GLOBALS['SRL_CSS'].'?'.time();
$cssObjFile = \FilesModel::findByUuid($this->srl_css_file);
if ($cssObjFile === null)
{
if (!Validator::isUuid($this->srl_css_file))
{
$this->log($GLOBALS['TL_LANG']['ERR']['version2format'],'ModuleSRLayer.php srl_css_file','TL_ERROR');
}
}
$GLOBALS['TL_CSS'][] = ($cssObjFile->path) ? $cssObjFile->path : $GLOBALS['SRL_CSS'].'?'.time();
foreach($GLOBALS['SRL_JS']['mootools'] as $jsSource)
{
......
<?php
/**
* angepasster Tipp von BugBuster
* @url: https://community.contao.org/de/showthread.php?45946-fileTree-Felder-f%FCr-Contao-3-2-migrieren-in-eigenen-Erweiterungen
*/
class srlayerRunonceJob extends Controller
{
public function __construct()
{
parent::__construct();
$this->import('Database');
}
public function run()
{
//Check for update to C3.2
if ($this->Database->tableExists('tl_module'))
{
$arrFields = $this->Database->listFields('tl_module');
$blnDone = false;
//check for one table and field
foreach ($arrFields as $arrField)
{
if ($arrField['name'] == 'srl_css_file' && $arrField['type'] != 'varchar')
{
$blnDone = true;
}
}
// Run the version 3.2 update in two tables
if ($blnDone == false)
{
Database\Updater::convertSingleField('tl_module', 'srl_css_file');
}
}
}
}
$srlayerRunonceJob = new srlayerRunonceJob();
$srlayerRunonceJob->run();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment