Cannot use a scalar value as an array

Until now I’ve received two times a notification from users about a PHP error appearing in the widgets admin “Cannot use a scalar value as an array”. After doing some Googling and analyzing my own code I think I have found the problem. A possible bugfix  for this is applied to the development version 1.2.4.

UPDATE May 15, 2010: It seems the bug is finally fixed in the development version 1.2.6

5 Comments to “Cannot use a scalar value as an array”

  • It’s still there in 1.2.4, unfortunately, at least on my site. Running WP 2.9.2, it appears on the widget page in WP-Admin and when editing a certain widget.

    Warning: Cannot use a scalar value as an array in /home/david78j/justanotherstagingserver.com/wp-content/plugins/dynamic-widgets/dynamic-widgets.php on line 159

    • Bummer! Can you please tell me on which widget it happens? I hope that will bring me to a solution of this nasty problem.

  • It doesn’t happen on any specific widget.

    The error message appears on /wp-admin/widgets.php at the top of the page.

    It also appears when creating a new widget, e.g. a Text Widget, when I drag it onto a widget bar. The widget will first appear, but then after a short while the fields will be replaced by the message. If I save the widget, the message will go away.

    • I’m unable to reproduce the error. I think the combination with another plugin is causing the error. Would you please send me a dump. You can find how to make one at the FAQ 4. Please send the dump via a bugreport to me (see also FAQ 5).

      • I’ve just uploaded version 1.2.6 which hopefully now fixes that nasty PHP warning bug.