Attempts to restore Hogfather compatibility#294
Attempts to restore Hogfather compatibility#294eduardomozart wants to merge 1 commit intosamuelet:masterfrom
Conversation
The class PageResolver doesn't exists on DokuWiki Hogfather and older releases, so this PR attempts to fix samuelet#291 by falling back to the old function "resolve_id" to parse NS if the class PageResolver isn't available.
|
There are also a lot of changes, e.g. by using php7.4 functionalities, that break compatibility with old DokuWiki releases. Is it worth to add these kind of things back? Better people update there DokuWiki in time, such that the updates remain relatively smaller… and hopefully easier. |
| $ns = getNs($resolver->resolveId($ns)); | ||
| return $ns === false ? '' : $ns; | ||
| } else { | ||
| return resolve_id(getNS($id), $ns); |
There was a problem hiding this comment.
In general resolve_id() should not be used. But I guess the old code did this already…
There was a problem hiding this comment.
Yes, the old code already uses this function. I noticed that there's a lot of depreciation errors about IndexMenu plug-in, as it still references "resolve_id" and "resolve_pageid" functions that wasn't migrated to PageResolver yet, so I believe that we migrate all those functions or keep it until we migrate them all.
I agree. I didn't want to support those legacy DokuWiki versions neither, but I believe this is the only func that breaks compatibility with older DokuWiki releases, so users that doesn't have DokuWiki control can still keep IndexMenu updated. |
The class PageResolver doesn't exists on DokuWiki Hogfather and older releases, so this PR attempts to fix #291 by falling back to the old function "resolve_id" to parse NS if the class PageResolver isn't available.