• opvelp

    (@opvelp)


    Hello,
    I just had to deactivate this plugin because it generated this error after I updated to WP 5.3: Warning: Declaration of AVH_Walker_Category_Checklist….

    Any suggestions?

Viewing 15 replies - 1 through 15 (of 19 total)
  • nholzmann01

    (@nholzmann01)

    I have the same error. Looking forward to hearing any suggestions!

    cutu234

    (@cutu234)

    Same here.

    cyrfer

    (@cyrfer)

    You may try to edit two lines with the same content in these two files:
    /plugins/extended-categories-widget/4.2/class/avh-ec.widgets.php line 62
    /plugins/extended-categories-widget/4.2/class/avh-ec.core.php line 876

    Change both lines from:
    public function walk($elements, $max_depth) {
    to:
    public function walk($elements, $max_depth, …$args) {

    The warning will be gone, please test if the plugin still works as desired.

    Thread Starter opvelp

    (@opvelp)

    Thank you for the suggestion, but it feels like we’re doing your work for you. Doesn’t it mean it’s time for an update to your plugin?

    cyrfer

    (@cyrfer)

    Don’t blame me. It’s not my plugin, i just stumbled over the same problem, found your question by googling it, then tried to solve it by myself and wanted to share my solution. You’re welcome.

    Thread Starter opvelp

    (@opvelp)

    Oops, sorry! Thanks for trying to help out!

    cutu234

    (@cutu234)

    Thanks for helping out, but your suggestion does not work for me. By the way, is this valid PHP syntax?

    …$args

    Have never seen this before, and my code editor throws an error.

    aaronwordpress

    (@aaronwordpress)

    cyrfer
    Thank you for your post!!!
    When I pasted your correction it did not work.
    When I manually typed in the following it did work.
    public function walk($elements, $max_depth, …$args) {

    cyrfer

    (@cyrfer)

    Hi aaron, thanks for your feedback.
    Sorry, on the way from my tested code to my posting here the three dots ... before $args were somewhere replaced by an ellipsis – looks similar, but is as wrong as a greek question mark instead of a semicolon (the classic prank).

    And yes, with three dots it is valid PHP, see https://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list

    Edit: just learned that the CODE-Tag in the editor here prevents the three-dots-replace.
    Change both lines from:
    public function walk($elements, $max_depth) {
    to:
    public function walk($elements, $max_depth, ...$args) {

    • This reply was modified 5 years ago by cyrfer. Reason: The editor here replaced three dots with ellipsis where the dots are essential
    • This reply was modified 5 years ago by cyrfer.
    cutu234

    (@cutu234)

    Thanks again. Made the same mistake. Now, it’s working. Code editor still shows a syntax error. Well, who cares!

    Thanks for helping out, buddy!

    aaronwordpress

    (@aaronwordpress)

    Is there any way we can encourage Peter van der Does, the author of this great plugin, to update it?

    WordPress reads, “Last updated:3 years ago”.

    Thread Starter opvelp

    (@opvelp)

    Worked like a charm, with manually typing ‘…’. Thanks all, especially @cyrfer! And sorry again for my misunderstanding. :-/

    BeeCee

    (@csigncsign)

    Thank you @cyrfer for your solution, works fine now!

    Json Koning

    (@minion08)

    thank you @cyrfer – much appreciated

    John

    (@dsl225)

    Thanks!

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Widget generates error with upgrade to WP 5.3’ is closed to new replies.