?
avatar mokhin-denis
mokhin-denis
12 May 2017

Steps to reproduce the issue

  1. My site works fine on PHP 7.0.14
  2. After switch on PHP 7.1 site down with error '0 - Using $this when not in object context'
  3. Looking to Call stack I see:

1 JApplicationCms::getMenu() JROOT\libraries\cms\application\site.php:272
2 JApplicationSite::getMenu() JROOT\modules\mod_my_cloud\mod_my_cloud.php:69

  1. mod_my_cloud.php:69 is: $menus = &JSite::getMenu();
  2. After commenting line 69 in mod_my_cloud.php works ok

Expected result

Actual result

System information (as much as possible)

System Information
PHP Built On Windows NT C45779 6.1 build 7601 (Windows 7 Enterprise Edition Service Pack 1) AMD64
Database Version 5.5.22
Database Collation utf8_general_ci
Database Connection Collation utf8mb4_general_ci
PHP Version 7.1.5
Web Server Apache/2.4.23 (Win64) OpenSSL/1.0.2h PHP/7.1.5
WebServer to PHP Interface apache2handler
Joomla! Version Joomla! 3.7.0 Stable [ Amani ] 25-April-2017 15:36 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0

Additional comments

avatar mokhin-denis mokhin-denis - open - 12 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 12 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 May 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 12 May 2017

looks like Issue with non-Core-Module (mod_my_cloud), so closing. If i'm wrong, please feel free to reopen.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15976.

avatar franz-wohlkoenig franz-wohlkoenig - change - 12 May 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-05-12 05:37:00
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 12 May 2017
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 12 May 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 12 May 2017
avatar mokhin-denis
mokhin-denis - comment - 12 May 2017

Its not only about non-Core-Module. Its about error in JApplicationCms::getMenu() JROOT\libraries\cms\application\site.php:272 when using &JSite::getMenu() in PHP 7.1

avatar franz-wohlkoenig franz-wohlkoenig - change - 12 May 2017
Status Closed Discussion
Closed_Date 2017-05-12 05:37:00
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - change - 12 May 2017
Status Discussion New
Closed_Date 0000-00-00 00:00:00
avatar joomla-cms-bot joomla-cms-bot - reopen - 12 May 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 12 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 12 May 2017
Category Libraries
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 12 May 2017

@mokhin-denis thanks, reopened.

avatar Bakual
Bakual - comment - 12 May 2017

$menus = &JSite::getMenu();

That code is plain wrong, that is the issue. I'm surprised this even worked before. JSiteis just a useless helper class from com_search.
To fetch the active menu, you do JFactory::getApplication()->getMenu()

Closing as non-core issue. The issue is using wrong code in that module.

avatar Bakual Bakual - change - 12 May 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-05-12 06:17:53
Closed_By Bakual
avatar Bakual Bakual - close - 12 May 2017

Add a Comment

Login with GitHub to post a comment