• Resolved rindphi

    (@rindphi)


    Recently, I started to experience an error which shows up whenever I open a non-Gutenberg (Classic Editor) page in our website. The effect was that everything after the heading was left blank (so, the basic scaffold of the side appears, but the content is not rendered). Apache shows the following error:

    PHP Fatal error: Cannot redeclare addScriptAttributes() (previously declared in [path-to-wp]/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php on line 309

    I could solve the issue myself by editing advanced-gutenberg-main.php and wrapping the definition of addScriptAttributes() like this:

    if (!function_exists('addScriptAttributes')) {
        function addScriptAttributes(...) {
            ...
        }
    }

    I don’t know why that’s suddenly a problem (it used to work before, no new plugins were installed, but some have been updated), but the above hack solves the problem for non-Gutenberg pages, and Gutenberg pages (also those with Advanced-Gutenberg blocks) also work.

    Maybe you want to integrate the quick-fix or look for the real error cause.

    Thanks and Best Regards!

    • This topic was modified 6 years, 3 months ago by rindphi.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Fatal error: Cannot redeclare addScriptAttributes()’ is closed to new replies.