Jetpack by WordPress.com
[resolved] header.php call by reference php error in mobile minileven jetpack theme (4 posts)

  1. bagofminds
    Posted 2 years ago #


    At jetpack/modules/minileven/theme/pub/minileven/header.php at line 32 the call to array_shift() expects a reference (giving an error writ large on mobile web sites) when passed array_values().
    An easy fix is just to move the call to array_values() to a temporary variable before the call and pass the variable:

    $menu_id = array_shift( array_values( $location ) ); // access the ID of the...etc...

    $locs = array_values( $location );
    $menu_id = array_shift( $locs ); // access the ID of the...etc...


    Phil Basker


  2. Brandon Kraft
    Happiness Engineer
    Plugin Contributor

    Posted 2 years ago #


    What version of PHP are you running and/or could you provide additional information for me to confirm the error?

    I wasn't able to reproduce this when engaging the mobile theme. I've prepared a pull request on GitHub (currently waiting at https://github.com/kraftbj/Jetpack/tree/1919374 , but I'd like to be able to reproduce the error :)


  3. bagofminds
    Posted 2 years ago #

    Hi Brandon

    I am running osx server 3.1.1 with php 5.4.24 zend 2.4.0
    The theme is the vanilla twenty fourteen theme
    Plugins akismet 3.0.0 codesnippetlibrary 1.1 jetpack 2.9.3 stat counter 1.6.6 ukcookieconsent 1.7.1

    I have just undone the fix on my site so if you go to https://www.bagofminds.com/wordpress you should see it on a mobile device (I am using an iphone)

    - phil

  4. Brandon Kraft
    Happiness Engineer
    Plugin Contributor

    Posted 2 years ago #

    Sounds good. I have 5.3 and 5.5 handy, so missing 5.4 to test it on.

    Pushed the PR to https://github.com/Automattic/jetpack/pull/552 for confirmation/merging.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Jetpack by WordPress.com
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic