0
Welcome Guest! Login
0 items Join Now

SOLVED Fatal error: Cannot use object of type Closure as array in /home/pepaura3/p

  • SOLVED Fatal error: Cannot use object of type Closure as array in /home/pepaura3/p

    Posted 8 years 5 months ago
    • Getting this error on the front page of my site after updating gantry 5 in wordpress. Went in to admin and saw an update for gantry 5 after update front end of site displaying below error. See attached image.
      You are not authorised to see this attachment.




      "Fatal error: Cannot use object of type Closure as array in /home/pepaura3/public_html/pursuitoffreedomshow.com/wp-content/plugins/gantry5/src/classes/Gantry/WordPress/Widgets.php on line 293"
    • Last Edit: 8 years 5 months ago by Pepe Le Pew. Reason: [SOLVED]
  • Re: SOLVED Fatal error: Cannot use object of type Closure as array in /home/pepaura3/p

    Posted 8 years 5 months ago
    • This what line 293 looks like

      if (!isset($widget_obj[0]) || !is_object($widget_obj[0])){
  • Re: SOLVED Fatal error: Cannot use object of type Closure as array in /home/pepaura3/p

    Posted 8 years 5 months ago
    • Experiencing this exact issue on a new install of a WordPress site. d.pr/i/UR9w
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: SOLVED Fatal error: Cannot use object of type Closure as array in /home/pepaura3/p

    Posted 8 years 5 months ago
  • Re: SOLVED Fatal error: Cannot use object of type Closure as array in /home/pepaura3/p

    Posted 8 years 5 months ago
    • Hi,

      Sorry about that. Looks like a bug slipped in. This is already fixed in the Gantry CI build and will be released on monday with 5.2.1.

      If you want to fix it now please edit the wp-content/plugins/gantry5/src/classes/Gantry/WordPress/Widgets.php line 293 and change this :
      if (!isset($widget_obj['callback'][0]) || !is_object($widget_obj['callback'][0])) {
      to this :
      if (!is_array($widget_obj['callback']) || !isset($widget_obj['callback'][0]) || !is_object($widget_obj['callback'][0])) {

      Sorry about it.

      Jakub
    • Remember to always post a link to the site you're having problem with.
  • Re: SOLVED Fatal error: Cannot use object of type Closure as array in /home/pepaura3/p

    Posted 8 years 5 months ago
    • This has not fixed the issue
  • Re: SOLVED Fatal error: Cannot use object of type Closure as array in /home/pepaura3/p

    Posted 8 years 5 months ago
    • Sorry, spoke too soon, yes it has
  • Re: SOLVED Fatal error: Cannot use object of type Closure as array in /home/pepaura3/p

    Posted 8 years 5 months ago
    • Sorry I didn't post sooner I had fixed it on my own by changing zero to 1.
  • Re: SOLVED Fatal error: Cannot use object of type Closure as array in /home/pepaura3/p

    Posted 8 years 5 months ago
    • I have since changed it to Jakub's recommended fix.
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: SOLVED Fatal error: Cannot use object of type Closure as array in /home/pepaura3/p

    Posted 8 years 5 months ago

Time to create page: 0.068 seconds