• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Resolved Template public:xa_cas_index_macros: [E_USER_WARNING]

hbk1

New Member
AMS Premium
CAS Premium
RMS Premium
SC Premium
UBS Premium
Hi,

Upgrading from Xenforo 2.2.8P1 to 2.3.4 and CAS from 2.2.14 to 2.3.6
PHP version8.3.6
MySQL version8.0.40 (8.0.40-0ubuntu0.24.04.1)
Server softwareApache/2.4.58

Any hint what can be wrong? (Opcache is cleared.)

I get the following errors when selecting Full-Carousel in
Widget definition
Classified Ads System: Latest ads
and the view is corrupt.

Template errors
Template public:xa_cas_index_macros: [E_USER_WARNING] Accessed unknown getter 'content_image' on XenAddons\CAS:Category[8] (src/XF/Mvc/Entity/Entity.php:224)
Template public:xa_cas_index_macros: [E_USER_WARNING] Accessed unknown getter 'ad_type' on XenAddons\CAS:AdItem[1789] (src/XF/Mvc/Entity/Entity.php:224)
Template public:xa_cas_index_macros: [E_USER_WARNING] Accessed unknown getter 'ad_type' on XenAddons\CAS:AdItem[1789] (src/XF/Mvc/Entity/Entity.php:224)
Template public:xa_cas_index_macros: [E_USER_WARNING] Accessed unknown getter 'ad_type' on XenAddons\CAS:AdItem[1789] (src/XF/Mvc/Entity/Entity.php:224)
Template public:xa_cas_index_macros: [E_USER_WARNING] Accessed unknown getter 'ad_type' on XenAddons\CAS:AdItem[1789] (src/XF/Mvc/Entity/Entity.php:224)
Template public:xa_cas_index_macros: [E_USER_WARNING] Accessed unknown getter 'ad_type' on XenAddons\CAS:AdItem[1789] (src/XF/Mvc/Entity/Entity.php:224)
Template public:xa_cas_index_macros: [E_USER_WARNING] Accessed unknown getter 'ad_type' on XenAddons\CAS:AdItem[1789] (src/XF/Mvc/Entity/Entity.php:224)
Template public:xa_cas_index_macros: [E_USER_WARNING] Accessed unknown getter 'ad_type' on XenAddons\CAS:AdItem[1571] (src/XF/Mvc/Entity/Entity.php:224)

Stack trace​

#0 src/XF/Mvc/Entity/Entity.php(140): XF\Mvc\Entity\Entity->get('ad_type')
#1 internal_data/code_cache/templates/l3/s10/public/xa_cas_index_macros.php(776): XF\Mvc\Entity\Entity->offsetGet('ad_type')
#2 src/XF/Template/Templater.php(922): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#3 internal_data/code_cache/templates/l3/s10/public/xa_cas_widget_latest_ads.php(43): XF\Template\Templater->callMacro('xa_cas_index_ma...', 'ads_carousel', Array, Array)
#4 src/XF/Template/Templater.php(1800): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#5 src/XF/Widget/WidgetRenderer.php(62): XF\Template\Templater->renderTemplate('xa_cas_widget_l...', Array)
#6 src/XF/Widget/WidgetRenderer.php(67): XF\Widget\WidgetRenderer->render()
#7 internal_data/code_cache/templates/l3/s10/public/_page_node.409.php(68): XF\Widget\WidgetRenderer->__toString()
#8 src/XF/Template/Templater.php(1800): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#9 src/XF/Template/Templater.php(1874): XF\Template\Templater->renderTemplate('_page_node.409', Array)
#10 internal_data/code_cache/templates/l3/s10/public/page_view.php(93): XF\Template\Templater->includeTemplate('public:_page_no...', Array)
#11 src/XF/Template/Templater.php(1800): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#12 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('page_view', Array)
#13 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#14 src/XF/Mvc/Dispatcher.php(471): XF\Mvc\Renderer\Html->renderView('XF:Page\\View', 'public:page_vie...', Array)
#15 src/XF/Mvc/Dispatcher.php(453): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#16 src/XF/Mvc/Dispatcher.php(412): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#17 src/XF/Mvc/Dispatcher.php(66): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#18 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#19 src/XF.php(806): XF\App->run()
#20 index.php(23): XF::runApp('XF\\Pub\\App')
#21 {main}

Stack trace​

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', '/var/www/upgrad...', 224)
#1 src/XF/Mvc/Entity/Entity.php(224): trigger_error('Accessed unknow...', 512)
#2 src/XF/Mvc/Entity/Entity.php(140): XF\Mvc\Entity\Entity->get('ad_type')
#3 internal_data/code_cache/templates/l3/s10/public/xa_cas_index_macros.php(776): XF\Mvc\Entity\Entity->offsetGet('ad_type')
#4 src/XF/Template/Templater.php(922): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#5 internal_data/code_cache/templates/l3/s10/public/xa_cas_widget_latest_ads.php(43): XF\Template\Templater->callMacro('xa_cas_index_ma...', 'ads_carousel', Array, Array)
#6 src/XF/Template/Templater.php(1800): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#7 src/XF/Widget/WidgetRenderer.php(62): XF\Template\Templater->renderTemplate('xa_cas_widget_l...', Array)
#8 src/XF/Widget/WidgetRenderer.php(67): XF\Widget\WidgetRenderer->render()
#9 internal_data/code_cache/templates/l3/s10/public/_page_node.409.php(68): XF\Widget\WidgetRenderer->__toString()
#10 src/XF/Template/Templater.php(1800): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#11 src/XF/Template/Templater.php(1874): XF\Template\Templater->renderTemplate('_page_node.409', Array)
#12 internal_data/code_cache/templates/l3/s10/public/page_view.php(93): XF\Template\Templater->includeTemplate('public:_page_no...', Array)
#13 src/XF/Template/Templater.php(1800): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#14 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('page_view', Array)
#15 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#16 src/XF/Mvc/Dispatcher.php(471): XF\Mvc\Renderer\Html->renderView('XF:Page\\View', 'public:page_vie...', Array)
#17 src/XF/Mvc/Dispatcher.php(453): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#18 src/XF/Mvc/Dispatcher.php(412): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#19 src/XF/Mvc/Dispatcher.php(66): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#20 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#21 src/XF.php(806): XF\App->run()
#22 index.php(23): XF::runApp('XF\\Pub\\App')
#23 {main}
 
Solution
Thanks. It is fixed now and there are no modified templates. We reinstalled and now it works. The carousel is not as before but we just skipped it.
Those are caused by OUTDATED or Improperly merged, Templates (templates that have been modified, that were not properly updated with new changes).

Accessed unknown getter 'content_image' <---- that is an OLD FIELD name that was replaced by 'content_image_url'. You have some outdated templates that are using 'content_image' when they should be using 'content_image_url' instead.

Accessed unknown getter 'ad_type' <---- that is an OLD FIELD name that was replaced by 'type'. You have some outdated templates that are using 'ad_type' when they should be using 'type' instead.

Use the XF Template search for the term content_image and that will bring up all of the templates that OLD field name is being used in. Its probably a good idea to REVERT those so that 100% of the code that should be there, is there and then reapply any customizations to that template.

Do the same thing for the term ad_type
 
do a search on .ad_type so that it only picks up if its a FIELD NAME and not the names of macros are placeholders for phrases.

The error messages are telling you the name of the template (xa_cas_index_macros) and the name of the macro (ads_carousel). Look at ALL of your Styles and see if the template xa_cas_index_macros has customized and if so, revert it/them.

If not, edit the template, find the ads_carousel macro and look for $ad.ad_type and replace with $ad.type.

I don't know how the hell you have an UNEDITED template that has OLD code in it. that doesn't make sense, since the upgrade REPLACES any templates that are not customized with new templates.
 
Another thing that COULD be in play but shouldn't is CACHED Widgets. If you have any Widgets created via CAS Ad Widget Definitions, edit them and save them (that flushes widget cache, which could have old template code cached).
 
do a search on .ad_type so that it only picks up if its a FIELD NAME and not the names of macros are placeholders for phrases.
This is just going to confuse you because its going to find phrase place holder 'ad_type': $extra.ad_type_label|raw, which is used in 100's of templates.

Just focus on the xa_cas_index_macros template for now and then post the stack trace on the unknown getter 'content_image' error, which will mention which template that one contains the old field and I can explain what to look for ;)
 
If you want me to assist in sorting it for you, start a ticket and give me Admin CP login credentials with Admin permission to edit templates. Someone else had this same exact issue and I fixed it for them in a few minutes (and it was customized templates, even tho they swore they didn't have any lol). More than willing to help ;)
 
Thanks. It is fixed now and there are no modified templates. We reinstalled and now it works. The carousel is not as before but we just skipped it.
 
  • Like
Reactions: Bob
Solution
Back
Top