WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. bagofminds
    Member
    Posted 9 months ago #

    Hi

    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:
    ie:

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

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

    Regards

    Phil Basker

    https://wordpress.org/plugins/jetpack/

  2. Brandon Kraft
    Happiness Engineer
    Plugin Author

    Posted 9 months ago #

    Howdy,

    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 :)

    Cheers!

  3. bagofminds
    Member
    Posted 9 months 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 Author

    Posted 9 months 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.

Reply

You must log in to post.

About this Plugin

About this Topic