Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix php8 error in function.php #368

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jh23453
Copy link
Contributor

@jh23453 jh23453 commented Mar 6, 2022

I got the message:
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
in /usr/share/ganglia-webfrontend/functions.php on line 732

This messages is likely new with php7.3. Will be an error with PHP8.
For details see https://wiki.php.net/rfc/continue_on_switch_deprecation

This in one small step to get ready for php8. See #361

I got the message:
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
 in /usr/share/ganglia-webfrontend/functions.php on line 732

This messages is likely new with php7.3. Will be an error with PHP8.
For details see https://wiki.php.net/rfc/continue_on_switch_deprecation

This in one small step to get ready for php8. See ganglia#361
@jh23453
Copy link
Contributor Author

jh23453 commented Jul 21, 2022

I now think that the following change would be better (pseudo-patch):

  case "standard":
    // Does view have any items/graphs defined
-    if ( count($view['items']) == 0 ) {
+    if ( count($view['items']) != 0 ) {
-      continue;
-      // print "No graphs defined for this view. Please add some";
-    } else {
      // Loop through graph items
      foreach ($view['items'] as $item_id => $item) {

@zeekus zeekus mentioned this pull request Aug 22, 2023
@berlin2123
Copy link
Contributor

Thanks, this Warning is fixed now in PR #376, as the same in your PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants