On a clean simplytest.me/project/breakpoints install we delete all but the 1x multiplier. Now when trying to create a breakpoint, on form submit the following notice and warning appear:

Notice: Undefined index: multipliers in breakpoints_admin_breakpoints_submit() (line 482 of /home/se93d0a0820604d3/www/sites/default/modules/breakpoints/breakpoints.admin.inc).
Warning: array_filter() expects parameter 1 to be array, null given in breakpoints_breakpoint_save() (line 466 of /home/se93d0a0820604d3/www/sites/default/modules/breakpoints/breakpoints.module).

Or even worse, when you later on remove all multipliers but 1x and try to add / alter breakpoints, a white PHP error screen appears with:

Fatal error: Unsupported operand types in /home/se93d0a0820604d3/www/sites/default/modules/breakpoints/breakpoints.module on line 468

This is due the fact that breakpoints_admin_breakpoints() in breakpoints.admin.inc removes the 1x multiplier by default and leaves us with an empty set of multiplier checkboxes which cannot be processed on form submit. The 1x multiplier also seems to be removed in other functions.

The quickest workaround is to add an unused multiplier.

CommentFileSizeAuthor
#3 breakpoints-2210159-3.patch2.98 KBAnonymous (not verified)

Comments

attiks’s picture

can you provide a patch to fix it?

lmeurs’s picture

I am afraid not, sorry, I am not familiar with this module.

Anonymous’s picture

StatusFileSize
new2.98 KB

breakpoints_admin_breakpoints() removes the 1.x checkboxes from the form - this should re-create the 1x multiplier when saving the form data.

Hope this works - bear with me, my first effort at creating a patch.

attiks’s picture

Assigned: Unassigned » jelle_s
Status: Active » Needs review
jelle_s’s picture

Fixed in latest dev. Thanks for the patch!

jelle_s’s picture

Assigned: jelle_s » Unassigned
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.