• Resolved dimal

    (@dimalifragis)


    Hi,

    This is a strange Warning that appeared WITHOUT touching anything in your widget. I just added a NEW widget from an other plugin and moved it above your’s.

    [27-Feb-2024 10:23:38 UTC] PHP Warning: Undefined array key “widget_id” in /home/public_html/wp-content/plugins/top-10/includes/frontend/widgets/class-posts-
    widget.php on line 285

    Lines 285, same on 356, 357, 350 , 339, 285

    Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Ajay

    (@ajay)

    Can you try removing the widget and then adding it back in? Remember the configurations when you remove it. The widget_id should exist so it’s quite strange as it’s given an error that it doesn’t.

    Thread Starter dimal

    (@dimalifragis)

    Does it matter if i add it with classic widgets or Gutenberg?

    I use classic widgets because i see no option in Gutenberg to change the Title of the widgets, shows “Currently trending:”

    • This reply was modified 9 months ago by dimal.
    Plugin Author Ajay

    (@ajay)

    Both are build differently – the former is the traditional widget. That is what is created by the code above.

    The gutenberg one is the block and you might have to add the heading separately etc

    I tend to use one or the other on my sites – more the block in recent times.

    Thread Starter dimal

    (@dimalifragis)

    I use classic widgets because i see no option in Gutenberg to change the Title of the widgets, shows “Currently trending:”

    i’m missing something?

    Thread Starter dimal

    (@dimalifragis)

    Either way i still get the warnings. They seem to happen only when i move up down.

    Plugin Author Ajay

    (@ajay)

    You’ll need to turn off the heading (in block settings panel) and then add your own heading. Then if you right click on both you can group them into a “widget group”.

    Plugin Author Ajay

    (@ajay)

    Do the warnings disappear when you save the widgets page and check on the frontend?

    I’m wondering if this is a temporary thing that the widget_id is being changed so you get this error.

    Thread Starter dimal

    (@dimalifragis)

    Yes, only once (several for the lines i mentioned), but once i clear them out, i never seen those again if i don’t up/down the widget.

    So i’m ok, i guess. I see no other problem.

    I use also Widget Context plugin, to display some widgets where i want and where not, maybe that has some relation?

    Plugin Author Ajay

    (@ajay)

    I’ll need to test – never used these before. Which is the plugin you are putting up and down and also where are you seeing this error? Screenshot will help as I can go do some checking.

    I’ll mark this resolved for now as it does work barring that warning which I’ll need to investigate.

    Thread Starter dimal

    (@dimalifragis)

    Ok, i think i found what is the cause. I added the widget with Classic Widgets enabled (the old widgets WP interface) and then i disabled Classic Widgets and continued with Gutenberg.

    Thanks.

    • This reply was modified 9 months ago by dimal.
    Plugin Author Ajay

    (@ajay)

    That’s interesting. I think I had to change things with Gutenberg as it didn’t do the typical separate ID etc. But, it has been a while.

    Definitely worth pointing to people in case someone else has an issue.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘PHP Warnings’ is closed to new replies.