• Resolved simonmm

    (@simonmm)


    Since updating to v1.6.9 of GDPR Cookie Consent on 25 October we see frequent errors in our PHP log:

    [25-Oct-2018 16:00:50 UTC] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/wp/wp-content/plugins/cookie-law-info/admin/class-cookie-law-info-admin.php on line 159

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @simonmm,

    We are using a WordPress variable in the PHP code to arrange settings page in the side menu which is missing in your installation and causing the warning.

    Could you please mention which version of WordPress you are using and let us know if you have made any modification to the dashboard appearance.

    tobyy

    (@tobyy)

    i’ve got the same problem.
    WordPress 4.9.8 (Multisite)
    GDPR Cookie Consent 1.6.9

    in the dashboard, i see the following warning when i am logged in as EDITOR! there is no warning message when i am logged in as ADMINISTRATOR.

    Warning: Invalid argument supplied for foreach() in /mypathtoWP/wp-content/plugins/cookie-law-info/admin/class-cookie-law-info-admin.php on line 159

    Warning: Cannot modify header information – headers already sent by (output started at /mypathtoWP/wp-content/plugins/cookie-law-info/admin/class-cookie-law-info-admin.php:159) in /mypathtoWP/wp-admin/includes/misc.php on line 1126

    i guess the easiest way to solve this is to turn off php warnings, but maybe you have a better solution.

    [edit]OK i guess we are hiding menu elements for editors, and that is causing the warning?[/edit]

    • This reply was modified 6 years ago by tobyy.
    Plugin Author WebToffee

    (@webtoffee)

    Hi @tobyy, @simonmm,

    Thank you for taking the time to analyze this, @tobyy. Since the menu elements are hidden for editors, that is causing the error. We have released a bug fix update(v1.6.10) to remove the warnings.

    Thread Starter simonmm

    (@simonmm)

    WordPress 4.9.8
    Woocommerce 3.5.0
    PHP 7.2.11
    Theme Storefront 2.3.5

    GDPR CC v1.6.10 has not prevented the PHP error message appearing every time a user who does not have the Settings option in their left side menu logs in.
    We don’t see the line 1126 error that tobyy did though – only the line 159 error.

    We use the Members v2.1.0 plugin to create a “View Orders/Contributor” role which can see Woocommerce orders, so is only granted:

    General -> Read
    Posts -> Edit Posts
    Posts -> Delete Posts
    Posts -> Read
    Pages -> Read
    Orders -> edit_shop_orders
    Refunds -> edit_shop_orders
    Users -> List Users
    Custom -> read_shop_order
    Custom -> view_woocommerce_reports

    So when they log in, their side menu just contains:

    Dashboard
    Home
     Admin Search
    Posts
    Comments
    Orders
    GDPR Cookie Consent
    Sales Reports
    Users
    Tools
    Plugin Author WebToffee

    (@webtoffee)

    Hi @simonmm,

    As this is a site-specific issue, we need to check from your site. Please reach us via support forum and share the site details.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘GDPR CC v1.6.9 introduced PHP errors’ is closed to new replies.