• I updated Types on a dev website and got and error 500.

    Searching the logs showed this:

    PHP Fatal error: ‘break’ not in the ‘loop’ or ‘switch’ context in /var/www/mysite/wp-content/plugins/types/embedded/common/toolset-forms/lib/adodb-time.inc.php on line 1012

    I opened the file types/embedded/common/toolset-forms/lib/adodb-time.inc.php

    I deleted the ‘break’ statement.
    The site then worked as expected.

    Googling the error lead me to this post:

    http://stackoverflow.com/questions/34871198/fatal-error-break-not-in-the-loop-or-switch-context-in


    12
    down vote
    PHP 5.x.x, a break statement outside a for, foreach or switch statement DID NOT throw an error message and was syntactically okay.

    PHP 7.0 and higher, a break statement is no longer permitted outside a for, foreach or switch statement and gives a fatal error.”

    Could it be that the latest iteration of Types wasn’t tested on PHP7?

    In any case, I hope that this post is useful to others with the same error.
    But obviously hacking the plugin isn’t the best solution.

Viewing 1 replies (of 1 total)
  • Plugin Support Beda

    (@bedas)

    This is a very old error and is solved in the current Types version (since a few months now).

    Are you sure you are using the latest 2.2.4 Types?

Viewing 1 replies (of 1 total)
  • The topic ‘PHP Fatal error: ‘break’ not in the ‘loop’ or ‘switch’’ is closed to new replies.