Closed SlimDeluxe closed 8 years ago
I could reproduce your problem. Was the block plugin 'datatable' in the plugins folder by file block.datatable.php? What happens if you replace 'datatable' with another block plugin like 'textformat'?
I have modified compileAllTemplates() to clear all internal caches for each template to eliminate every chance of side effects from compilation of other templates. The update is in the dev-master branch. Any feedback is welcome.
Sorry I have found out the problem was in an old plugin function.datatable I have in one of the plugin dirs (it is not a block plugin)... Before using compileAllTemplates() I use setPluginsDir() which I though removes all plugins from other packages (each package has it own plugins dir). While it does remove the directories, it does not "unload" any already loaded plugins, so this was the problem. I have renamed the function now and everything works again.
However there's a code problem with your latest commit:
A PHP Error was encountered
Severity: 4096
Message: Argument 2 passed to Smarty_Internal_Method_CompileAllTemplates::compileAllTemplates() must be an instance of Smarty, string given
Filename: sysplugins/smarty_internal_method_compilealltemplates.php
Line Number: 35
A PHP Error was encountered
Severity: 4096
Message: Argument 1 passed to Smarty_Internal_Method_CompileAllTemplates::compileAll() must be an instance of Smarty, string given, called in /var/www/dev/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compilealltemplates.php on line 38 and defined
Filename: sysplugins/smarty_internal_method_compilealltemplates.php
Line Number: 53
( ! ) Fatal error: Call to a member function getTemplateDir() on string in /var/www/dev/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compilealltemplates.php on line 62 Call Stack Time Memory Function Location 1 0.0000 240304 {main}( ) .../backend.php:0 2 0.0014 289432 require_once( '/var/www/dev/_backend/core/SDLX_CodeIgniter.php' ) .../backend.php:208 3 0.1926 1435752 call_user_func_array:{/var/www/dev/_backend/core/SDLX_CodeIgniter.php:370} ( ) .../SDLX_CodeIgniter.php:370 4 0.1926 1436040 Maintainance->gettext_compile( ) .../SDLX_CodeIgniter.php:370 5 0.1929 1439736 Utilities->gettext_compile( ) .../maintainance.php:180 6 0.2143 1645808 compileAllTemplates ( ) .../Utilities.php:243 7 0.2143 1646296 Smarty_Internal_Data->__call( ) .../Utilities.php:243 8 0.2143 1646592 Smarty_Internal_Extension_Handler->_callExternalMethod( ) .../smarty_internal_data.php:241 9 0.2145 1650320 call_user_func_array:{/var/www/dev/vendor/smarty/smarty/libs/sysplugins/smarty_internal_extension_handler.php:96} ( ) .../smarty_internal_extension_handler.php:96 10 0.2145 1650872 Smarty_Internal_Method_CompileAllTemplates->compileAllTemplates( ) .../smarty_internal_extension_handler.php:96 11 0.2158 1659832 Smarty_Internal_Method_CompileAllTemplates->compileAll( ) .../smarty_internal_method_compilealltemplates.php:38
you must update to the complete dev-master version because of some other internal changes.
Not sure what you mean by that, my composer.json is
"smarty/smarty": "dev-master"
so I have the latest commit. Switching to one commit before that
"smarty/smarty": "dev-master#dccfc6c2f5f519ff2db1b24de2ccb0283554b8c7"
makes it work again
If I install "smarty/smarty": "dev-master" at my place everything is okay. Have you tried not to update but reinstall Smarty by composer?
I don't know what's the difference, but I tried it anyway. Deleted "smarty/smarty" from composer.json. Ran "composer update" which removed the smarty folder. Then put it back as "dev-master". Ran update again and the same errors are shown.
I've taken a look at line 35 of sysplugins/smarty_internal_method_compilealltemplates.php
public function compileAllTemplates(Smarty $dummy, Smarty $smarty, $extension = '.tpl', $force_compile = false, $time_limit = 0,
$max_errors = null)
If I change this to
public function compileAllTemplates(Smarty $smarty, $extension = '.tpl', $force_compile = false, $time_limit = 0,
$max_errors = null)
(removed $dummy param) it seems to be working again.
the fix is now in the master branch
@uwetews
What about the same in compileAllConfig(Smarty $dummy, Smarty $smarty, ...)
? And they both are also noted in the PHPDoc header.
@ophian Ian you are right both methods are new fixed in the master branch
I am using compileAllTemplates() for gettext extraction, but I just found out that it does not work with custom block functions. While the template works perfectly as expected, the following error is returned when using compileAllTemplates()
Line 79 is {/block}, while the whole layout is like this:
If I remove the {block page_body} wrapper and not use an extends statement (ie. remove inheritance), it still does not work, but the error is different:
Running on dev-master.
Regards