I don't know if it's an oversight but Bug https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22661 removed relative_urls : false and now it's impossible to enter a link with a local URL, like a report. cf. https://www.tiny.cloud/docs/configure/url-handling/#document_base_url
How does this bug manifest? I did a quick test to add a relative url to IntranetMainUserBlock and it seemed to work for me.
1 create a report 1 if it doesn't exist 2 open /cgi-bin/koha/tools/koha-news.pl 3 create a news 4 add a HTML link with Insert/Edit link tinyMCE dialog box to /cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run%20this%20report "report 1" 5 save 6 on the main page "report 1" link returns a 404 error TinyMCE has replaced /cgi-bin/koha/reports.... with ../reports/guided_reports.pl?reports=1&phase=Run%20this%20report document_base_url isn't set and 'This option specifies the base URL for all relative URLs in the document. The default value is the directory of the current document. If a value is provided, it must specify a directory (not a document) and must end with a /.'
Ah, sorry, you're right. I see it now too.
Created attachment 106250 [details] [review] Bug 25862: TinyMCE editor mangles local url links in tools/koha-new.pl To test: 1 create a report 1 if it doesn't exist 2 open /cgi-bin/koha/tools/koha-news.pl 3 create a news 4 add a HTML link with Insert/Edit link tinyMCE dialog box to /cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run%20this%20report "report 1" 5 save 6 on the main page "report 1" link returns a 404 error Apply patch 7 Modify news' URL 8 It works
Created attachment 106251 [details] [review] Bug 25862: TinyMCE editor mangles local url links in tools/koha-new.pl To test: 1 create a report 1 if it doesn't exist 2 open /cgi-bin/koha/tools/koha-news.pl 3 create a news 4 add a HTML link with Insert/Edit link tinyMCE dialog box to /cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run%20this%20report "report 1" 5 save 6 on the main page "report 1" link returns a 404 error Apply patch 7 Modify news' URL 8 Test it works in: tools/koha-new.pl admin/branches.pl and admin/preferences.pl
Created attachment 106856 [details] [review] Bug 25862: TinyMCE editor mangles local url links in tools/koha-new.pl To test: 1 create a report 1 if it doesn't exist 2 open /cgi-bin/koha/tools/koha-news.pl 3 create a news 4 add a HTML link with Insert/Edit link tinyMCE dialog box to /cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run%20this%20report "report 1" 5 save 6 on the main page "report 1" link returns a 404 error Apply patch 7 Modify news' URL 8 Test it works in: tools/koha-new.pl admin/branches.pl and admin/preferences.pl Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 106893 [details] [review] Bug 25862: TinyMCE editor mangles local url links in tools/koha-new.pl To test: 1 create a report 1 if it doesn't exist 2 open /cgi-bin/koha/tools/koha-news.pl 3 create a news 4 add a HTML link with Insert/Edit link tinyMCE dialog box to /cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run%20this%20report "report 1" 5 save 6 on the main page "report 1" link returns a 404 error Apply patch 7 Modify news' URL 8 Test it works in: tools/koha-new.pl admin/branches.pl and admin/preferences.pl Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 107085 [details] [review] Bug 25862: Prevent TinyMCE to mangles local url links To test: 1 create a report 1 if it doesn't exist 2 open /cgi-bin/koha/tools/koha-news.pl 3 create a news 4 add a HTML link with Insert/Edit link tinyMCE dialog box to /cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run%20this%20report "report 1" 5 save 6 on the main page "report 1" link returns a 404 error Apply patch 7 Modify news' URL 8 Test it works in: tools/koha-new.pl admin/branches.pl and admin/preferences.pl Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Didier, make sure you write correct commit titles. Usually copy/paste of the bug report title is not a good idea for bugfixes. See https://wiki.koha-community.org/wiki/Commit_messages#Examples
Pushed to master for 20.11, thanks to everybody involved!
To me this bug is not minor as it has some serious implications with more HTML system prefs finding their way into the News feature, which is a good thing! That is also why I will also shamelessly plug Bug 22660 here. If we could use TinyMCE or CodeMirror in the news cool I'd be more comfortable. :) Thanks Didier!
(In reply to Lucas Gass from comment #11) > To me this bug is not minor as it has some serious implications with more > HTML system prefs finding their way into the News feature, which is a good > thing! That's a good point. I actually was bitten recently because post-upgrade the existing HTML got mangled after they did an update. I worked around it, but I imagine many people could have been bitten by this and not known how to work around it.
backported to 20.05.x for 20.05.03
backported to 19.11.x for 19.11.09
Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed.