• Hello,

    Your plugin is great and works flawlessly on my site, but since I am updating the site with Oxygen, I’ve got an error.

    It is caused by a class name issue.

    So, when I Add your plugin onto Oxygen I get the following error message:

    No ‘llocMslsMslsWidget’ widget registered in this installation

    I have narrowed down the error message to the oxygen file in plugins/oxygen/component-framework/components/layouts/widget.php, line 40

    This error happens after the following test failed:

    if ( $GLOBALS[‘wp_widget_factory’]->widgets[$options[‘class_name’]] ) {

    $options[‘class_name’] contains ‘llocMslsMslsWidget’ but there is no such entry in $GLOBALS[‘widget_factory’], here is an excerpt of the var_dump:

    ‘Akismet_Widget’ =>
    object(Akismet_Widget)[724]
    ….
    ‘lloc\Msls\MslsWidget’ =>
    object(lloc\Msls\MslsWidget)[725]

    How does oxygen get this class name? They do:

    $component_json = file_get_contents(‘php://input’);
    $component = json_decode($component_json, true);
    $options = $component[‘options’][‘original’];

    It looks to me that it is an error on their side but on the other hand the problem comes from the headers, when I look in Chrome inspector, I get this:

    Request URL: http://my.site/en/welcome/?action=ct_render_widget&nonce=xxxxxxxxxxx&post_id=10973

    options: {nicename: “Multisite Language Switcher (#108)”,…}
    id: {class_name: “llocMslsMslsWidget”, id_base: “mslswidget”, pretty_name: “Multisite Language Switcher”,…}
    model: {dont_render: “false”, placeholder-width: “”, placeholder-height: “”, background-color: “”,…}

    bottom-unit: “px”
    class_name: “llocMslsMslsWidget”
    clear: “none”
    ct_content: “”

    So, maybe it is an issue with WordPress, I haven’t digged that far, or with your widget, but I don’t see how. The class name should definitely be ‘lloc\Msls\MslsWidget’ here.

    Since I’m not expecting you to remove the namespace, I would understand if you dismissed that issue, but if there is a solution on your side I would appreciate 🙂

    ETA: I have opened a ticket on WP bug tracker https://core.trac.ww.wp.xz.cn/ticket/46541

    • This topic was modified 7 years, 2 months ago by dlorre.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    Interesting … I had to change something 3 months ago. It had to do with the namespace and the id so I inserted the id_base “mslswidget”.

    And you say, the widget is saved like that even if you remove and re-add it?

    Thanks for this nice debug!

    Thread Starter dlorre

    (@dlorre)

    Hi Dennis,

    I don’t think that it has anything to do with id_base, the problem seems to be with class_name that does not contain the ‘\’.

    Oxygen support gave me a workaround which is to use

    the_widget('lloc\Msls\MslsWidget');

    in a code block.

    Cheers,
    Dominique

    Plugin Author Dennis Ploetner

    (@realloc)

    Ah, ok … so let’s watch the ticket that you created (or help there).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Error with Oxygen’ is closed to new replies.