Hi, when trying to update to the latest version of this module, I get the following error:

Ett AJAX HTTP-fel inträffade
Resultatkod för HTTP: 200
Felsökningsinformation följer.
Sökväg: /update.php/start?id=171&op=do_nojs&op=do
Statustext: OK
Svarstext: 
Fatal error:  'break' not in the 'loop' or 'switch' context in /home/fotosbyp/public_html/modules/search404/src/Controller/Search404Controller.php on line 83

and
Fatal error: 'break' not in the 'loop' or 'switch' context in /home/fotosbyp/public_html/modules/search404/src/Controller/Search404Controller.php on line 116

The errror message is in swedish, but I guess that the line "Fatal error" says all that is important. The error goes away when I add # in front of the break. But seems like a rather ugly solution.

Comments

b0red created an issue. See original summary.

anish.a’s picture

Status: Active » Needs review
StatusFileSize
new1.14 KB

The break is unnecessary there. Removing it.

ziomizar’s picture

Status: Needs review » Active

This issue was introduced in https://www.drupal.org/node/2770527.
I did a patch using 'return' instead of 'break' to mantain the same logic as in search404Goto().

ziomizar’s picture

StatusFileSize
new1.18 KB
ziomizar’s picture

Status: Active » Needs review
anish.a’s picture

Yes. Return works well. Have to verify that anyway, whether return is infact intended usage.

b0red’s picture

Thanx for such a quick fix :)

mslabba_zyxware’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the fix @Anish, @ziomizar

mslabba_zyxware’s picture

Status: Reviewed & tested by the community » Fixed

Successfully merged the patch

Status: Fixed » Closed (fixed)

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

alan d.’s picture

Shouldn't this be rolled into a new release ASAP?