WordPress.org

Forums

Polylang
[resolved] Warning: reset() expects parameter 1 to be array (7 posts)

  1. Guillermo
    Member
    Posted 11 months ago #

    I got this warning :

    Warning: reset() expects parameter 1 to be array, null given in /home/artandfi/www/wp-content/plugins/polylang/admin/admin-filters-columns.php on line 81

    Could someone tell me if it is a problem and how to resolve it?

    Note. I'm working in a network version of wordpress.

    https://wordpress.org/plugins/polylang/

  2. Chouby
    Member
    Plugin Author

    Posted 11 months ago #

    Hello!

    Could you precise the circumstances? When do you get this warning?

  3. Guillermo
    Member
    Posted 11 months ago #

    Hello Chouby,

    I really appreciate your reactivity, as usual.

    I sought the warning for the first time when I was developing a theme for a blog that is not suppose to be multilingual and where I'm not using the plugin (The Lupita Project).

    I suspect the problem could be related with another plugin that is central on this particular project, the Event Organiser plugin. Actually, the warning is only appearing when I'm editing an event (something like a post) in the dashboard, and exclusively in the view for a quick edit. The message of warning is repeated many times. I take a picture of the screen that you can temporarily see here.

  4. Chouby
    Member
    Plugin Author

    Posted 11 months ago #

    I did not succeed to to reproduce the warning, even with plugin Event organizer active, but nevertheless, could you try to edit the line 81 of polylang/admin/admin-filters-columns.php and replace:

    return reset($columns);

    by

    return empty($columns) ? '' : reset($columns);
  5. Guillermo
    Member
    Posted 11 months ago #

    Yes Choubi, this changement works perfectly !

    So, I have edited the file directly on the plugin's folder, not in a child. Should I do it?

  6. Chouby
    Member
    Plugin Author

    Posted 11 months ago #

    You can edit directly the file. That's not an issue as Polylang 1.5.1 will include this fix.

  7. Guillermo
    Member
    Posted 11 months ago #

    Cool, thank you !

Reply

You must log in to post.

About this Plugin

  • Polylang
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic