Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken for Greebo due to internallink class #26

Open
tsfstarr opened this issue May 20, 2022 · 2 comments
Open

Broken for Greebo due to internallink class #26

tsfstarr opened this issue May 20, 2022 · 2 comments

Comments

@tsfstarr
Copy link

The current version does not work with Greebo.
Replacing syntax.php with the 2018 version fixes it.
It looks like the 2020 hogfather pull request, which changed the internallink class, broke it for Greebo.

@bby-bishopclark
Copy link

Are we unable to choose code compatible with each version via some IF statement? Compatibility is a great thing for reducing user churn if it's possible.

@bby-bishopclark
Copy link

bby-bishopclark commented Aug 8, 2022

Are we unable to choose code compatible with each version via some IF statement? Compatibility is a great thing for reducing user churn if it's possible.

(It should be noted this is just a minimal hack to get the service running again)


--- /usr/share/dokuwiki/lib/plugins/flowcharts/syntax.php~      2020-08-01 00:37:16.000000000 -0700
+++ /usr/share/dokuwiki/lib/plugins/flowcharts/syntax.php       2022-08-08 12:16:05.357527898 -0700
@@ -96,7 +96,12 @@
         $std_modes = array('internallink', 'media','externallink');

         foreach($std_modes as $m){
+            if(class_exists('dokuwiki\\Parsing\\ParserMode\\'.ucfirst('media'))) {
             $class = 'dokuwiki\\Parsing\\ParserMode\\'.ucfirst($m);
+           } else {
+               $class = "Doku_Parser_Mode_$m";
+           }
+
             $obj   = new $class();
             $modes[] = array(
                 'sort' => $obj->getSort(),
@@ -109,7 +114,12 @@
         $fmt_modes = array('strong','emphasis','underline','monospace',
                            'subscript','superscript','deleted');
         foreach($fmt_modes as $m){
+           if(class_exists('dokuwiki\\Parsing\\ParserMode\\'.ucfirst('media'))) {
             $obj   = new \dokuwiki\Parsing\ParserMode\Formatting($m);
+            } else {
+               $obj   = new Doku_Parser_Mode_formatting($m);
+            }
+
             $modes[] = array(
                 'sort' => $obj->getSort(),
                 'mode' => $m,
@@ -117,8 +127,17 @@
             );
         }

+
+        if(class_exists('dokuwiki\\Parsing\\ParserMode\\'.ucfirst('media'))) {
         // Create the parser and handler
         $Parser = new Parser(new Doku_Handler());
+       } else {
+            // Create the parser
+            $Parser = new Doku_Parser();
+
+            // Add the Handler
+            $Parser->Handler = new Doku_Handler();
+       }

         //add modes to parser
         foreach($modes as $mode){

This was referenced Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants