zioth / dokuwiki-autotooltip

DokuWiki plugin to add styled tooltip functionality, and to automatically generate link tooltips based on page abstracts.
MIT License
5 stars 4 forks source link

Doesn't work with MRedirect plugin #9

Closed high5five closed 5 years ago

high5five commented 5 years ago

I'm using autotooltip with MRedirect and it causes redirects to plugin-autotooltip_linked

zioth commented 5 years ago

Looking at the mredirect source code, I don't see how that's possible. mredirect processes the raw wiki text of the page, so it shouldn't interact with autotooltip at all. And plugin-autotooltip_linked is a CSS class name, so it shouldn't be involved in redirects anyway.

Are you sure that mredirect is the issue? What other plugins do you have installed? What does the redirected url look like? What does the wiki source of your page look like? Is this a public wiki that I could look at?

high5five commented 5 years ago

Sorry, the wiki isn't public yet. This is only happening on pages where the MRedirect plugin is used for redirection of pages with similar titles. This is what the URL looks like http://xxx.xxx.xxx.xx/dokuwiki/plugin-autotooltip_linked after I have clicked the link to the page that contains the redirect.

When I disable auto-tooltips, things are working fine with the above setup. The moment I enable it, the pages start getting redirected to plugin-autotooltip_linked. I even get an option to create the page.

zioth commented 5 years ago

Since I'm the one who created autolink4, I doubt it's the issue. :) I use the two together without a problem.

What you're seeing is caused by some strange code in mredirect, which renders the HTML of the link, then tries to extract the URL. I don't know whether mredirect is maintained. To fix it yourself, go into mredirect/action.php and replace these lines:

              $parts = explode('|', $inner);
              $url = html_wikilink ($parts[0], $name=null, $search='');
              $url = substr ($url, strpos ($url, '"') + 1);
              $url = substr ($url, 0, strpos ($url, '"'));

with this:

              $url = wl($inner);
high5five commented 5 years ago

Since I'm the one who created autolink4, I doubt it's the issue. :) I use the two together without a problem.

What you're seeing is caused by some strange code in mredirect, which renders the HTML of the link, then tries to extract the URL. I don't know whether mredirect is maintained. To fix it yourself, go into mredirect/action.php and replace these lines:

              $parts = explode('|', $inner);
              $url = html_wikilink ($parts[0], $name=null, $search='');
              $url = substr ($url, strpos ($url, '"') + 1);
              $url = substr ($url, 0, strpos ($url, '"'));

with this:

              $url = wl($inner);

Thank you! That got it working!