Title: Invalid argument supplied in controller.php
Last modified: August 21, 2016

---

# Invalid argument supplied in controller.php

 *  Resolved [Ptr.pl](https://wordpress.org/support/users/ptrpl/)
 * (@ptrpl)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-in-controllerphp/)
 * I have added multilanguage function to my site using Polylang plugin.
    Everything
   works fine on default language pages and posts. After switching language to other,
   at the bottom of the page there is a list of warnings visible: Warning: Invalid
   argument supplied for foreach() in /home/(…)/wp-content/plugins/simple-lightbox/
   controller.php on line 934
 * Example page:
    [http://trochimiuk.pl/2014/03/norway-bjorkedalen/](http://trochimiuk.pl/2014/03/norway-bjorkedalen/)
 * Please fix it. I like simple lightbox plugin very much and I don’t want to look
   for another.
 * [https://wordpress.org/plugins/simple-lightbox/](https://wordpress.org/plugins/simple-lightbox/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Archetyped](https://wordpress.org/support/users/archetyped/)
 * (@archetyped)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-in-controllerphp/#post-4712105)
 * Hi, can you please provide more detail on what you mean when you say “After switching
   language to other”?
 * Where and how are you switching the language? Please provide specific steps so
   I can reproduce your issue.
 * Thank you.
 *  Thread Starter [Ptr.pl](https://wordpress.org/support/users/ptrpl/)
 * (@ptrpl)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-in-controllerphp/#post-4712152)
 * Thank you for your quick response.
 * In fact, the method used to switch language doesn’t matter. Problem with simple-
   lightbox warnings occurs on all English pages and posts containing pictures. 
   All Polish content is free of warnings.
    Maybe one fact is important: I have 
   started my blog in Polish only and then I have translated content to additional
   language (English).
 * My blog allows to switch language by using widget with flags (English/Polski).
   You can also add language code to URL:
    [http://trochimiuk.pl/pl](http://trochimiuk.pl/pl)
   or [http://trochimiuk.pl/en](http://trochimiuk.pl/en).
 * A warning is displayed at the bottom of the page as many times as the number 
   of pictures on page.
 * Google shows two more blogs with the same error, try this:
    [“simple-lightbox/controller.php on line 934”](https://www.google.pl/?gfe_rd=ctrl&ei=pOQmU4b5LauK8QfiqYD4DQ&gws_rd=cr#q=%22simple-lightbox%2Fcontroller.php+on+line+934%22)
 * I am able to reproduce the same behavior on test page.
    1. Clean install of WordPress 3.8.1
    2. Plugin installation: simple-lightbox and polylang
    3. Uploading media – JPG file
    4. Translating media</>
    5. Publishing post in Polish
    6. Adding english version of post
    7. Replacing media with english version
 * Post in first language is displayed without warnings, but the second is with 
   warning.
 * Polylang documentation:
    - [Language settings](http://polylang.wordpress.com/documentation/setting-up-a-wordpress-multilingual-site-with-polylang/settings/)
    - [Translating media](http://polylang.wordpress.com/documentation/setting-up-a-wordpress-multilingual-site-with-polylang/translating-media/)
 * Piotr
 *  Plugin Author [Archetyped](https://wordpress.org/support/users/archetyped/)
 * (@archetyped)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-in-controllerphp/#post-4712174)
 * Thanks for the additional details. Unfortunately, your issue could not be reproduced,
   which may be due to your specific Polylang settings.
 * I will need to take a closer look at your site. Please create a temporary admin
   account for your site and send the login information to [support@archetyped.com](https://wordpress.org/support/topic/invalid-argument-supplied-in-controllerphp/support@archetyped.com?output_format=md)
   so that I can take a closer look.
 * Thanks.
 *  Thread Starter [Ptr.pl](https://wordpress.org/support/users/ptrpl/)
 * (@ptrpl)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-in-controllerphp/#post-4712201)
 * Yesterday I gave you access to my test site where I reproduced the problem. Did
   you find anything?
    Piotr
 *  Plugin Author [Archetyped](https://wordpress.org/support/users/archetyped/)
 * (@archetyped)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-in-controllerphp/#post-4712204)
 * Your email wasn’t flagged so thanks for the head’s up.
 *  Plugin Author [Archetyped](https://wordpress.org/support/users/archetyped/)
 * (@archetyped)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-in-controllerphp/#post-4712257)
 * The issue is due to the fact that Polylang modifies post queries without authorization.
   SLB’s code has been hardened against modifications like this in v2.3.0.
 * The beta version of SLB 2.3 is now available to test: [SLB 2.3.0 (Beta 3)](https://github.com/archetyped/simple-lightbox/releases/tag/2.3.0-b3)
 * Unfortunately, due to Polylang’s query modifications, media metadata (title, 
   description, etc.) may not work properly. A dedicated add-on will likely be required
   if there is enough demand for working around Polylang’s issues.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Invalid argument supplied in controller.php’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/simple-lightbox.svg)
 * [Simple Lightbox](https://wordpress.org/plugins/simple-lightbox/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-lightbox/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-lightbox/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-lightbox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-lightbox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-lightbox/reviews/)

## Tags

 * [invalid argument](https://wordpress.org/support/topic-tag/invalid-argument/)

 * 6 replies
 * 2 participants
 * Last reply from: [Archetyped](https://wordpress.org/support/users/archetyped/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/invalid-argument-supplied-in-controllerphp/#post-4712257)
 * Status: resolved