0
Welcome Guest! Login
0 items Join Now

Gantry 4: Call to a member function (get) error...

    • Jim Dee's Avatar
    • Jim Dee
    • Sr. Rocketeer
    • Posts: 110
    • Thanks: 5
    • PHP, CSS, Gantry :-)

    Gantry 4: Call to a member function (get) error...

    Posted 5 years 9 months ago
    • I'm having a strange occurrence on a site of mine. It's running two different Gantry 4 templates (Graffito & Myriad). Recently, the client wanted me to do up a new design. So, I uploaded a super-basic template (per the normal Joomla guidelines for such), assigned a page, and it would not work. The error is: "Error: Call to a member function get() on null: Call to a member function get() on null"

      I thought I'd done something wrong, of course... So, I looked over the code, tried it again...same error. Frustrated, I then installed my blank test template on another site (which is running a Gantry 5 template, btw) ... all worked fine there. So, the blank test template was ok after all.

      So, something strange is happening on this Gantry 4 site. I then tried to assign a non-Gantry template (this time a standard Joomla Protostar) to an article. Same error as before. So, even Protostar won't work.

      Finally, I wondered what would happen if I installed another Gantry template. So, I threw Ricochet on there... assigned a page to it, and it DID work.

      So, I *think* this is some kind of Gantry error happening & it simply won't let me do anything ut Gantry on the site. On the other hand, I disabled the Gantry4 system plugin, and the error persists. So, I'm not 100% sure if it's Gantry-related. But, I cn say for sure that *only* Gantry sites will work on the site. Any ideas?

      If I put the site in full development / debug mode, all I see on the page is:
      Error: Call to a member function get() on null: Call to a member function get() on null

      -Jim

      ps Site is Joomla 3.9.3, Gantry is 4.1.39.
    • Last Edit: 5 years 9 months ago by Jim Dee.
    • ______________________
      Jim Dee
      Principal, Array Web Development * 503-902-HTML
      * SERVICES: Joomla!, RocketTheme/Gantry, PHP, MySQL, CSS/HTML
      * PORTFOLIO: http://www.arraywebdevelopment.com
      * WRITING: https://medium.com/web-design-web-developer-magazine
    • pdowse's Avatar
    • pdowse
    • Hero Rocketeer
    • Posts: 292
    • Thanks: 31

    Re: Gantry 4: Call to a member function (get) error...

    Posted 5 years 9 months ago
    • Check your PHP version - I've found that Gantry 4 doesn't play nice with 7.1 or 7.2.

      7.0 seems to be ok, depending on your setup.

      Hope that helps.
    • Good things come to those who wait - but it's only what's left over from those who don't
    • Jim Dee's Avatar
    • Jim Dee
    • Sr. Rocketeer
    • Posts: 110
    • Thanks: 5
    • PHP, CSS, Gantry :-)

    Re: Gantry 4: Call to a member function (get) error...

    Posted 5 years 9 months ago
    • Well, Gantry 4 works fine. It's running PHP 7.1.25 at the moment. My issue is that the site *only* lets me use Gantry, when I need it to allow me to use other templates. It's perplexing... I definitely don't want to downgrade PHP, though. I'd rather patch / hack Gantry4, if needed (although I'm unsure what the issue is here).
    • ______________________
      Jim Dee
      Principal, Array Web Development * 503-902-HTML
      * SERVICES: Joomla!, RocketTheme/Gantry, PHP, MySQL, CSS/HTML
      * PORTFOLIO: http://www.arraywebdevelopment.com
      * WRITING: https://medium.com/web-design-web-developer-magazine
    • pdowse's Avatar
    • pdowse
    • Hero Rocketeer
    • Posts: 292
    • Thanks: 31

    Re: Gantry 4: Call to a member function (get) error...

    Posted 5 years 9 months ago
    • Try going into Extensions / Manage / Manage and search for Gantry and just make sure everything is running the same version.

      I know with some of my Gantry updates I've had to uninstall older versions floating around and then manually re-install Gantry 4 (downloaded from gantry.org/ )
    • Good things come to those who wait - but it's only what's left over from those who don't
    • Jim Dee's Avatar
    • Jim Dee
    • Sr. Rocketeer
    • Posts: 110
    • Thanks: 5
    • PHP, CSS, Gantry :-)

    Re: Gantry 4: Call to a member function (get) error...

    Posted 5 years 9 months ago
    • NEW INFO: I've made a dev copy of the site in question and have been testing to solve this. I *think* in fact I've stated the problem wrong! I think the site itself has an issue, and Gantry happens to fix it somehow, which is why ONLY Gantry templates work on the site. The problem, I now think, is that my **Joomla hidden menu items** do not work unless they are on Gantry templates. Any hiden menu item I create and assign Protostar or whatever does *not* work -- throws the Error: Call to a member function get() on null: Call to a member function get() on null. Still researching, but if anyone has thoughts, I'd appreciate them. :-)
    • ______________________
      Jim Dee
      Principal, Array Web Development * 503-902-HTML
      * SERVICES: Joomla!, RocketTheme/Gantry, PHP, MySQL, CSS/HTML
      * PORTFOLIO: http://www.arraywebdevelopment.com
      * WRITING: https://medium.com/web-design-web-developer-magazine
    • pdowse's Avatar
    • pdowse
    • Hero Rocketeer
    • Posts: 292
    • Thanks: 31

    Re: Gantry 4: Call to a member function (get) error...

    Posted 5 years 9 months ago
    • It's possible that you have an extension that is not compatible with PHP 7 yet.

      Try:

      switching back to PHP 5.6
      upgrading all third party extensions to the latest versions

      See docs.google.com/spreadsheets/d/1HJj02l3B...t?pref=2&pli=1#gid=0 for which extensions are compatible with PHP 7.0.
    • Good things come to those who wait - but it's only what's left over from those who don't
    • Jim Dee's Avatar
    • Jim Dee
    • Sr. Rocketeer
    • Posts: 110
    • Thanks: 5
    • PHP, CSS, Gantry :-)

    Re: Gantry 4: Call to a member function (get) error...

    Posted 5 years 9 months ago
    • Thanks. I did try PHP5.6... That actually helped a bit, as the error reporting was more robust. Instead of the non-identifyable error shown below, it now included info as to the source:

      Notice: Undefined index: in ...public_html/libraries/gantry/gantry.php on line 126
      Notice: Trying to get property of non-object in .../public_html/libraries/gantry/gantry.php on line 207
      Fatal error: Call to a member function get() on null in .../public_html/libraries/gantry/gantry.php on line 267

      There have been other threads (all unsolved,as far as I could tell, related to this. One was:
      rockettheme.com/forum/gantry-for-joomla/...-member-function-get

      Anyway, the weird thing is that this was happening even if no pages were assigned to the Gantry templates I have installed. (The site uses two, and I'd installed a third for testing.) I tried assigning ALL pages to Protostar & was seeing the Gantry errors, above, on hidden-menu items only.

      Then I tried completely disabling all Gantry extensions (and templates) and still got those Gantry errors (which is weird because, if Gantry is totally disabled, why is it being called?).

      FINALLY... I *uninstalled* ALL Gantry extensions and templates... and bam, Protostar started working again.

      The issue isn't solved, unfortunately, because I still can't use Gantry AND a non-Gantry template along with it (at least on this Gantry4 site, on hidden-meun items). I also reinstalled all core Joomla files, just in case something was corrupt. Didn't help. IDK... I think I'm just gonna tell the client that, for this project, we need to get rid of Gantry altogether. It's Gantry4, anyway, so not a giant deal. I'd still love to know what's going on, though. Super frustrating!
    • ______________________
      Jim Dee
      Principal, Array Web Development * 503-902-HTML
      * SERVICES: Joomla!, RocketTheme/Gantry, PHP, MySQL, CSS/HTML
      * PORTFOLIO: http://www.arraywebdevelopment.com
      * WRITING: https://medium.com/web-design-web-developer-magazine
    • Kat05's Avatar
    • Kat05
    • Preeminent Rocketeer
    • Posts: 25898
    • Thanks: 334

    Re: Gantry 4: Call to a member function (get) error...

    Posted 5 years 9 months ago
    • pdowse wrote:
      Check your PHP version - I've found that Gantry 4 doesn't play nice with 7.1 or 7.2.

      7.0 seems to be ok, depending on your setup.

      Hope that helps.
      Hi there,

      could you be more specific about the issues you have with Gantry 4 on PHP 7.1 and 7.2?
      We're not aware of any issues in our latest versions, apart from a few notices which we're going to address soon.
    • Kat05 / QA Lead & Support / Germany
    • Kat05's Avatar
    • Kat05
    • Preeminent Rocketeer
    • Posts: 25898
    • Thanks: 334

    Re: Gantry 4: Call to a member function (get) error...

    Posted 5 years 9 months ago
    • Hi Jim,

      please feel free to share your link and super admin details with us in the secure tab and let is know on which page the errors can be seen.
    • Kat05 / QA Lead & Support / Germany
    • pdowse's Avatar
    • pdowse
    • Hero Rocketeer
    • Posts: 292
    • Thanks: 31

    Re: Gantry 4: Call to a member function (get) error...

    Posted 5 years 9 months ago
    • Certainly.

      In particular this website.
      crcore.org.au/ gets the following error message on anything above 7.0 (Sorry I can't keep showing the error message as it's a live site)


      Warning: session_start(): Failed to read session data: user (path: /opt/alt/php72/var/lib/php/session) in /home/wcwcdohj/public_html/libraries/joomla/session/handler/native.php on line 260
      Error: Failed to start application: Failed to start the session

      I will have to hunt around for some more, but that's the one I was thinking of (most of our client's we've upgraded to Gantry 5 - not too many 4's floating around)
    • Good things come to those who wait - but it's only what's left over from those who don't

Time to create page: 0.059 seconds