?
avatar BernhardWebstudio
BernhardWebstudio
13 Oct 2018

Steps to reproduce the issue

Open any page.

Expected result

No error.

Actual result

Error: 0 Using $this when not in object context

System information (as much as possible)

  • Joomla! 3.8.13 Stable [ Amani ] 9-October-2018 14:00 GMT
  • Plugins:
  • com_mailto : 3.0.0
  • com_wrapper : 3.0.0
  • com_admin : 3.0.0
  • com_banners : 3.0.0
  • com_cache : 3.0.0
  • com_categories : 3.0.0
  • com_checkin : 3.0.0
  • com_contact : 3.0.0
  • com_cpanel : 3.0.0
  • com_installer : 3.0.0
  • com_languages : 3.0.0
  • com_login : 3.0.0
  • com_media : 3.0.0
  • com_menus : 3.0.0
  • com_messages : 3.0.0
  • com_modules : 3.0.0
  • com_newsfeeds : 3.0.0
  • com_plugins : 3.0.0
  • com_search : 3.0.0
  • com_templates : 3.0.0
  • com_weblinks : 3.0.0
  • com_content : 3.0.0
  • com_config : 3.0.0
  • com_redirect : 3.0.0
  • com_users : 3.0.0
  • com_finder : 3.0.0
  • com_joomlaupdate : 3.6.2
  • com_tags : 3.1.0
  • com_contenthistory : 3.2.0
  • com_ajax : 3.2.0
  • com_postinstall : 3.2.0
  • com_fields : 3.7.0
  • com_associations : 3.7.0
  • PHPMailer : 5.2.6
  • SimplePie : 1.2
  • LIB_PHPUTF8 : 0.5
  • LIB_JOOMLA : 13.1
  • LIB_IDNA : 0.8.0
  • FOF : 2.4.3
  • LIB_PHPASS : 0.3
  • mod_articles_archive : 3.0.0
  • mod_articles_latest : 3.0.0
  • mod_articles_popular : 3.0.0
  • mod_banners : 3.0.0
  • mod_breadcrumbs : 3.0.0
  • mod_custom : 3.0.0
  • mod_feed : 3.0.0
  • mod_footer : 3.0.0
  • mod_login : 3.0.0
  • mod_menu : 3.0.0
  • mod_articles_news : 3.0.0
  • mod_random_image : 3.0.0
  • mod_related_items : 3.0.0
  • mod_search : 3.0.0
  • mod_stats : 3.0.0
  • mod_syndicate : 3.0.0
  • mod_users_latest : 3.0.0
  • mod_weblinks : 3.0.0
  • mod_whosonline : 3.0.0
  • mod_wrapper : 3.0.0
  • mod_articles_category : 3.0.0
  • mod_articles_categories : 3.0.0
  • mod_languages : 3.5.0
  • mod_finder : 3.0.0
  • mod_custom : 3.0.0
  • mod_feed : 3.0.0
  • mod_latest : 3.0.0
  • mod_logged : 3.0.0
  • mod_login : 3.0.0
  • mod_menu : 3.0.0
  • mod_popular : 3.0.0
  • mod_quickicon : 3.0.0
  • mod_status : 3.0.0
  • mod_submenu : 3.0.0
  • mod_title : 3.0.0
  • mod_toolbar : 3.0.0
  • mod_multilangstatus : 3.0.0
  • mod_version : 3.0.0
  • mod_stats_admin : 3.0.0
  • mod_tags_popular : 3.1.0
  • mod_tags_similar : 3.1.0
  • mod_sampledata : 3.8.0
  • plg_authentication_gmail : 3.0.0
  • plg_authentication_joomla : 3.0.0
  • plg_authentication_ldap : 3.0.0
  • plg_content_contact : 3.2.2
  • plg_content_emailcloak : 3.0.0
  • plg_content_loadmodule : 3.0.0
  • plg_content_pagebreak : 3.0.0
  • plg_content_pagenavigation : 3.0.0
  • plg_content_vote : 3.0.0
  • plg_editors_codemirror : 5.38.0
  • plg_editors_none : 3.0.0
  • plg_editors_tinymce : 4.5.8
  • plg_editors-xtd_article : 3.0.0
  • plg_editors-xtd_image : 3.0.0
  • plg_editors-xtd_pagebreak : 3.0.0
  • plg_editors-xtd_readmore : 3.0.0
  • plg_search_categories : 3.0.0
  • plg_search_contacts : 3.0.0
  • plg_search_content : 3.0.0
  • plg_search_newsfeeds : 3.0.0
  • plg_search_weblinks : 3.0.0
  • plg_system_languagefilter : 3.0.0
  • plg_system_p3p : 3.0.0
  • plg_system_cache : 3.0.0
  • plg_system_debug : 3.0.0
  • plg_system_log : 3.0.0
  • plg_system_redirect : 3.0.0
  • plg_system_remember : 3.0.0
  • plg_system_sef : 3.0.0
  • plg_system_logout : 3.0.0
  • plg_user_contactcreator : 3.0.0
  • plg_user_joomla : 3.0.0
  • plg_user_profile : 3.0.0
  • plg_extension_joomla : 3.0.0
  • plg_content_joomla : 3.0.0
  • plg_system_languagecode : 3.0.0
  • plg_quickicon_joomlaupdate : 3.0.0
  • plg_quickicon_extensionupdate : 3.0.0
  • plg_captcha_recaptcha : 3.4.0
  • plg_system_highlight : 3.0.0
  • plg_content_finder : 3.0.0
  • plg_finder_categories : 3.0.0
  • plg_finder_contacts : 3.0.0
  • plg_finder_content : 3.0.0
  • plg_finder_newsfeeds : 3.0.0
  • plg_finder_weblinks : 3.0.0
  • plg_finder_tags : 3.0.0
  • plg_twofactorauth_totp : 3.2.0
  • plg_authentication_cookie : 3.0.0
  • plg_twofactorauth_yubikey : 3.2.0
  • plg_search_tags : 3.0.0
  • plg_quickicon_phpversioncheck : 3.7.0
  • plg_editors-xtd_menu : 3.7.0
  • plg_editors-xtd_contact : 3.7.0
  • plg_system_fields : 3.7.0
  • plg_fields_calendar : 3.7.0
  • plg_fields_checkboxes : 3.7.0
  • plg_fields_color : 3.7.0
  • plg_fields_editor : 3.7.0
  • plg_fields_imagelist : 3.7.0
  • plg_fields_integer : 3.7.0
  • plg_fields_list : 3.7.0
  • plg_fields_media : 3.7.0
  • plg_fields_radio : 3.7.0
  • plg_fields_sql : 3.7.0
  • plg_fields_text : 3.7.0
  • plg_fields_textarea : 3.7.0
  • plg_fields_url : 3.7.0
  • plg_fields_user : 3.7.0
  • plg_fields_usergrouplist : 3.7.0
  • plg_content_fields : 3.7.0
  • plg_editors-xtd_fields : 3.7.0
  • plg_sampledata_blog : 3.8.0
  • plg_system_sessiongc : 3.8.6
  • isis : 1.0
  • English (en-GB) : 3.8.13
  • English (en-GB) : 3.8.13
  • GermanDE : 3.8.13.1
  • GermanDE : 3.8.13.1
  • German (Germany) Language Pack : 3.8.13.1
  • files_joomla : 3.8.13
  • plg_installer_webinstaller : 1.1.1
  • plg_editors_jce : 2.6.19
  • COM_JCE : 2.6.19
  • Widgetkit : 1.0.0
  • Widgetkit Twitter : 1.0.0
  • System - Widgetkit : 1.0.0
  • Content - Widgetkit : 1.0.0
  • System - Widgetkit ZOO : 3.1.0
  • System - Widgetkit Joomla : 1.0.0
  • widgetkit : 1.5.2
  • PLG_SYSTEM_KMFASTRANS_PRO : 3.0.0-PRO
  • KMFT Language Switcher : 3.0.0
  • mod_kmftdashboard : 3.0.0
  • mod_kmfttranslate : 3.0.0
  • com_kmfastrans : 3.0.0-PRO
  • Content - AddThis : 3.3.00
  • Content - Iframe Plugin : 1.6+
  • akeebabackup - de-DE : /Users/.../Projects/akeeba/backup/build/..
  • Akeeba : 6.2.1
  • plg_quickicon_akeebabackup : 1.0
  • PLG_SYSTEM_AKEEBAUPDATECHECK_TITLE : 1.1
  • PLG_SYSTEM_BACKUPONUPDATE_TITLE : 3.7
  • Akeeba Backup package : 6.2.1
  • plg_editors-xtd_module : 3.5.0
  • PLG_INSTALLER_FOLDERINSTALLER : 3.6.0
  • plg_installer_packageinstaller : 3.6.0
  • PLG_INSTALLER_URLINSTALLER : 3.6.0
  • plg_system_stats : 3.5.0
  • plg_system_updatenotification : 3.5.0
  • plg_content_jce : 2.6.19
  • plg_extension_jce : 2.6.19
  • plg_installer_jce : 2.6.19
  • plg_quickicon_jce : 2.6.0-pro-beta3
  • plg_system_jce : 2.6.19
  • PKG_JCE : 2.6.19
  • file_fef : 1.0.4
  • FOF30 : 3.3.6

Additional comments

Fix that worked for me but seems hacky: edit libraries/src/Application/CMSApplication.php:369, change $options['app'] = $this; to $options['app'] = self;.

avatar BernhardWebstudio BernhardWebstudio - open - 13 Oct 2018
avatar joomla-cms-bot joomla-cms-bot - change - 13 Oct 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 Oct 2018
avatar ReLater
ReLater - comment - 13 Oct 2018

You should ask in a Joomla forum because that's not a Joomla core issue. If you speak German you can start here to narrow down the error source/extension:
https://forum.joomla.de/thread/6467-fehler-finden-durch-detailliertere-fehlermeldung-debug-modus-call-stack/

avatar BernhardWebstudio
BernhardWebstudio - comment - 13 Oct 2018

Well, that's more or less what I did and what led me to the fix described in Additional comments:

Fix that worked for me but seems hacky: edit libraries/src/Application/CMSApplication.php:369, change $options['app'] = $this; to $options['app'] = self;.

As this relevant code is in the joomla application, I thought it would belong here. As I do have a fix, I supposedly do not need the forum. I do not mind closing this issue if you think it is an irrelevant bug / related to some plugin combination.

avatar BernhardWebstudio BernhardWebstudio - change - 13 Oct 2018
The description was changed
avatar BernhardWebstudio BernhardWebstudio - edited - 13 Oct 2018
avatar mbabker
mbabker - comment - 13 Oct 2018

The issue is related to how an extension is calling the getMenu() method of the application. Something is trying to call it in a static context (probably JSite::getMenu() or JApplicationSite::getMenu()), and static contexts do not have a $this variable. The correct way to call the method is generally JFactory::getApplication()->getMenu().

avatar BernhardWebstudio BernhardWebstudio - change - 13 Oct 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-10-13 11:58:48
Closed_By BernhardWebstudio
avatar BernhardWebstudio
BernhardWebstudio - comment - 13 Oct 2018

okay, I see, thanks very much!

avatar BernhardWebstudio BernhardWebstudio - close - 13 Oct 2018
avatar klainmaingr
klainmaingr - comment - 25 Oct 2018

The issue is related to how an extension is calling the getMenu() method of the application. Something is trying to call it in a static context (probably JSite::getMenu() or JApplicationSite::getMenu()), and static contexts do not have a $this variable. The correct way to call the method is generally JFactory::getApplication()->getMenu().

God bless. It has been messing with my head for the last hour or so after updating to PHP 7.2
A bit hacky indeed but it solved the issue (entire site was not functioning).
Even though it's a logical fix, I hope that it won't cause any other issues down the road.

Add a Comment

Login with GitHub to post a comment