1

We have a Plone 4.1 site. When I edit the HTML source of a document to use a path from the root directory (/codes in our case) and save it, Plone will translate the HTML (in our case it becomes ../codes). Is there a way to disable this, at least for this page? We cannot point to it using the file system because this is a virtual directory used to retrieve and display data from MySQL tables.

Here is some code:

<div class="agency_cd">The agency that is reporting the data. Agency codes are fixed values assigned by the National Water Information System (NWIS). A list of agency codes is available. <strong>[ <a class="internal-link" href="../codes/agency_cd_query?fmt=rdb">Tab-separated -- saved to file</a> || <a class="internal-link" href="../codes/agency_cd_query?fmt=html">HTML</a> ] </strong></div>

I change it to:

<div class="agency_cd">The agency that is reporting the data. Agency codes are fixed values assigned by the National Water Information System (NWIS). A list of agency codes is available. <strong>[ <a class="internal-link" href="/codes/agency_cd_query?fmt=rdb">Tab-separated -- saved to file</a> || <a class="internal-link" href="/codes/agency_cd_query?fmt=html">HTML</a> ] </strong></div>

I then save it, but Plone reverts it to the way it was before.

Mark
  • 351
  • 1
  • 9
  • Can you show us a snippet of the HTML you are changing? Use code formatting to show what it looks like. – Martijn Pieters Mar 15 '13 at 15:22
  • `
    The agency that is reporting the data. Agency codes are fixed values assigned by the National Water Information System (NWIS). A list of agency codes is available. [ Tab-separated -- saved to file || HTML ]
    `
    – Mark Mar 15 '13 at 15:41
  • You need to [edit] your question to add that. I can help formatting it if you have problems with that. – Martijn Pieters Mar 15 '13 at 15:42
  • Also, those are internal links, what exactly is the problem with them being made relative? It is far from clear how the relative link breaks things for you. – Martijn Pieters Mar 15 '13 at 15:44
  • The resulting URL is http://help.waterdata.usgs.gov/codes-and-parameters/codes/agency_cd_query?fmt=rdb which returns a 404. It should be http://help.waterdata.usgs.gov/codes/agency_cd_query?fmt=rdb – Mark Mar 15 '13 at 15:52
  • Right, and presumably `/codes-and-parameters/` is your Plone application? – Martijn Pieters Mar 15 '13 at 15:53
  • 1
    Does [Disable TinyMCE URL Conversions](http://stackoverflow.com/q/5196205) help? – Martijn Pieters Mar 15 '13 at 15:54
  • Correct. Both are, actually, the /codes/ area contains a call to a Plone MySQL plug in. – Mark Mar 15 '13 at 16:07
  • I'll have to let you know about that. Right now I cannot get into the ZMI. Looks like this should take care of my problem, so I appreciate your help. – Mark Mar 15 '13 at 16:12
  • It seems if I click the link saying to edit without the visual editor the code will stick once these changes were made. I am investigating now why it wants me to log in. It's a public system so it should not. – Mark Mar 15 '13 at 17:56
  • The problem was in part that the path should have been /code/ not /codes/. – Mark Mar 15 '13 at 19:39

2 Answers2

1

Disable TinyMCE URL Conversions was useful although I could not say it definitely solved my problem. I found that selecting the option on the Plone edit screen to not use the visual editor and edit the HTML seemed to offer a workaround. The link though is not obvious.

Mark
  • 351
  • 1
  • 9
1

Do file a bug report on this. The component at fault is an output filter that is automatically translating absolute links to the same host to relative ones. That filter probably poses problems for various "inside-out" rewriting schemes.

Meanwhile, I'll bet you can fix this with some custom rewrite rules. Put in a rewrite rule that looks for /codes-and-parameters/codes/(.+) URLs and rewrites them to /codes/$1. That way you won't need to break anything in Plone to work around the problem.

SteveM
  • 6,058
  • 1
  • 16
  • 20