opendb icon indicating copy to clipboard operation
opendb copied to clipboard

PHP7, Fatal error: "break" not in the loop, imdbsearch.class.php

Open thizmo opened this issue 7 years ago • 4 comments

Hi,

made an upgrade to latest opendb (git) and changed to PHP7.

Problem: After the upgrade, the imdbsearch got Error 500 in Browser and messages from subject in the log.

Solution:
(Quick fix only, while i am not a programmer)

  • Make a copy of the file
  • Find the two lines with "break" in the imdbsearch.class.php file
  • Replace it with "return false" (found as a solution on stackoverflow.com)
  • Reload the browser.

After that, everything worked as expected so far. Yet i haven't fully testet everything.

thizmo avatar May 07 '18 09:05 thizmo

Can you provide the actual stack overflow url you found

Can you provide the actual log errors

pellcorp avatar May 11 '18 01:05 pellcorp

Of course,

here you go. The error message (i shorted the url to the actual webspace): PHP Fatal error: 'break' not in the 'loop' or 'switch' context in /.../ht docs/opendb/lib/site/imdbphp2/imdbsearch.class.php on line 131

And the stackoverflow article: https://stackoverflow.com/questions/34871198/fatal-error-break-not-in-the-loop-or-switch-context-in The latest answer did the trick.

thizmo avatar May 14 '18 06:05 thizmo

If you can raise a pull request I will merge it. I don't have time for one myself

pellcorp avatar May 16 '18 22:05 pellcorp

There was a merge request merged mid April perhaps your issue has already been fixed seeing as it was a php 7 set of fixes

pellcorp avatar May 22 '18 01:05 pellcorp