Elxis CMS Forum

Extensions => Components => Topic started by: bledi on November 13, 2018, 17:30:39

Title: Problems with micro blog components
Post by: bledi on November 13, 2018, 17:30:39
Hello
I noticed that when i click Extension - Micro i get this error: HTTP ERROR 500

The detailed error message was:
ERROR in file ........./public_html/components/com_mikro/views/admin.html.php line 149 'break' not in the 'loop' or 'switch' context
This error was logged

I dont know since when is like this because i can publish blogs without problems.

Thanks for any help

Bledar
Title: Re: Problems with micro blog components
Post by: webgift on November 14, 2018, 09:57:28
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.

Example code:

<?php
if (2 == 1 + 1) {
    echo "Dummy Example of break inside if condition";
    break; // - Valid in php 5.*
           // - Gives a Fatal error in PHP 7.*.*:
           // "Fatal error: 'break' not in the 'loop' or 'switch' context in ... "
}
?>


So we have to make a short update in this file by simply replace three
break; statements inside if
with
return $freq;
Title: Re: Problems with micro blog components
Post by: bledi on November 20, 2018, 13:31:14
OK, thank you.
Changed according to suggestions and fixed