Menu

#724 part of the "Title" clipped by Roma, in a somewhat sneaky fashion

AMBER
open
5(default)
2015-07-27
2015-02-18
No

When I input the following into the "Title" window in the "Customize" tab in Roma:

TEI Lite customization for Twardowski's "O czynnościach i wytworach"

and press "save", the part enclosed in quotes vanishes, so the saved XML only contains

<title>TEI Lite customization for Twardowski's </title>

However, one can be easily mislead into thinking that everything is good (like when you have filled the "Description" window, and you click on "Save" and move on the e.g. the "Modules" or "Save.." tabs), because the full string is still displayed in the upper right corner, This is illustrated by the attached screenshot.

1 Attachments

Discussion

  • Martin Holmes

    Martin Holmes - 2015-02-18

    That information appears to be "saved" in the DOM input element where it was typed, in the form of its @value attribute, but that process screws up, resulting in:

    <input type="text" system""="" the="" of="" value="This is a test " size="53" name="title"...>
    

    for input of:

    This is a test "of the system". The bug must be somewhere in the JavaScript.

     
  • Martin Holmes

    Martin Holmes - 2015-02-18

    I've had a quick look through the code, and this is a possible source of error I see:

    tei-roma/parser/parser.php appears to generate output by performing a series of search-and-replace operations on a template. That would operate on this part of the templates/customizeCustomization.tem template file:

    <td class="formfield"><input type="text" name="title"
     size="53" value="{title}"></td>
    

    If it's not cautious about quotes (and it doesn't seem to be), it would end up creating output that closes the @value attribute prematurely and dumps the rest into the element creating invalid content, which the browser would attempt to parse into spurious attributes.

    The idea of storing text node content (which might even have elements in it, never mind quotes) in an HTML attribute value is very fragile, but it's the way the whole thing is built. It could be made more robust by some careful escaping of data values on the way in, but it'll take a bit of work.

     
  • Sebastian Rahtz

    Sebastian Rahtz - 2015-02-18

    i think Martin's analysis is spot on, and I am not surprised that Roma has some problems like this.

    perhaps you can find a PHP programmer to contribute some fixes, Piotr?

     
  • Hugh A. Cayless

    Hugh A. Cayless - 2015-03-12
    • assigned_to: Hugh A. Cayless
     
  • Hugh A. Cayless

    Hugh A. Cayless - 2015-05-30
    • assigned_to: Hugh A. Cayless --> Martin Holmes
     
  • Hugh A. Cayless

    Hugh A. Cayless - 2015-05-30

    Martin will have a go at this.

     
  • Martin Holmes

    Martin Holmes - 2015-07-27

    I've committed a fix for this. I've done a certain amount of testing locally, but until this is uploaded to wherever it is that Roma runs, I'm going to leave the bug open.

    https://github.com/TEIC/Roma/commit/18cc86ddcd79b409a9bfa406426fe4685c37fa8a

     

    Last edit: Martin Holmes 2015-07-27