Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smarty property 'sub_template' does not exist #216

Closed
mazzucode opened this issue Apr 12, 2016 · 13 comments
Closed

Smarty property 'sub_template' does not exist #216

mazzucode opened this issue Apr 12, 2016 · 13 comments

Comments

@mazzucode
Copy link

Hi,

After upgrade from Smarty 3.1.27 to 3.1.29 i am receiving this error:

Smarty property 'sub_template' does not exist

It is throwred by the file smarty_internal_extension_handler.php at the line 92.

Someone knows how can i solve this?

Thanks!

@uwetews
Copy link
Contributor

uwetews commented Apr 12, 2016

It does look like that you did extend the Smarty class and accessed a none Smarty property sub_template which was not declared. Errors like this are detected by Smarty's new extension handler which tries to resolve dynamic loading of seldom used methods.

@mazzucode
Copy link
Author

mazzucode commented Apr 12, 2016 via email

@uwetews
Copy link
Contributor

uwetews commented Apr 12, 2016

Good point. Because of some internal changes Smarty might not have seen the version change for all cases.

Delete all existing compiled and cache files after the upgrade. Looks like that some old files got loaded.

@mazzucode
Copy link
Author

I deleted the files of 'view_c' and 'cache' folders but the error persists. An additional information is that for some templates Smarty is working, but for others not.

Do you have any other idea about what can be happening? Thanks for your help!

@uwetews
Copy link
Contributor

uwetews commented Apr 14, 2016

The {include} tag in Smarty 3.1.27 did compile a call to getSubTemplate() but all of that code was removed in 3.1.29. So it's really strange.

Do you get a call stack with the exception that it could be traced further down?

@mazzucode
Copy link
Author

mazzucode commented Apr 14, 2016

Here is my call stack

/usr/share/evodevelopment/evolib/library/smarty/sysplugins/smarty_internal_data.php line 238 function _callExternalMethod()
/usr/share/evodevelopment/evolib/library/smarty/sysplugins/smarty_internal_template.php line 307 function __call()
/home/imobevodev/views_c/153d2837d046e1fd7f57cdd234e92826381df399_0.file.montador.tpl.php line 150 function __call()
/home/imobevodev/views_c/153d2837d046e1fd7f57cdd234e92826381df399_0.file.montador.tpl.php line 150 function getSubTemplate()
/usr/share/evodevelopment/evolib/library/smarty/sysplugins/smarty_template_resource_base.php line 122 function content_57102911d4d471_23575747()
/usr/share/evodevelopment/evolib/library/smarty/sysplugins/smarty_template_compiled.php line 199 function getRenderedTemplateCode()
/usr/share/evodevelopment/evolib/library/smarty/sysplugins/smarty_internal_template.php line 159 function render()
/usr/share/evodevelopment/evolib/library/smarty/sysplugins/smarty_internal_templatebase.php line 191 function render()
/usr/share/evodevelopment/evolib/library/smarty/sysplugins/smarty_internal_templatebase.php line 109 function _execute()
/usr/share/evodevelopment/evoimob/application/modulos/padrao/controllers/Principal.php line 23 function display()
/usr/share/evodevelopment/evokernel/resources/frontcontroller-app.php line 86 function index()
/home/imobevodev/public_html/index.php line 9 function require_once()

The error i am receiving is:

Fatal error: Uncaught --> Smarty: property 'sub_template' does not exist. <-- thrown in /usr/share/evodevelopment/evolib/library/smarty/sysplugins/smarty_internal_extension_handler.php on line 92

I am using the plugin include_if_exists, when i remove all calls to it the issue stops to happen.

Does exist a native feature in Smarty that to the same?

@fulopattila122
Copy link

fulopattila122 commented Apr 15, 2016

Hello, I'm the author of this tiny plugin: https://github.com/fulopattila122/smarty3-include-if-exists which is having issues calling getSubTemplate. See here. What method should be used instead of getSubTemplate() ?

@fulopattila122
Copy link

Is it maybe _subTemplateRender() ?

@mazzucode
Copy link
Author

@uwetews Could you help us please?

@uwetews
Copy link
Contributor

uwetews commented Apr 18, 2016

Yes the new function is _subTemplateRender()

@uwetews uwetews closed this as completed Apr 18, 2016
@mazzucode
Copy link
Author

Hi Attila,

Thanks for your feedback!

I updated the file, but i am receiving this error:

Fatal error: Uncaught --> Smarty: Smarty_Internal_Template->subTemplateRender() undefined method <-- thrown in /usr/share/evodevelopment/evolib/library/smarty/sysplugins/smarty_internal_undefined.php on line 46

Could you please help me with this issue?

@fulopattila122
Copy link

@masimao I think the issue belongs to my plugin, so I reopened the issue, let's continue the discussion over there.

@uwetews
Copy link
Contributor

uwetews commented Apr 24, 2016

@masimao You updated the file with the wrong method name. It must be '_subTemplateRender()'.
You missed the leading underscore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants