Bug 1065234
| Summary: | Seam Text parse error: expecting an opening angle bracket '<', found '&' | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Retired] Zanata | Reporter: | Sean Flanigan <sflaniga> | ||||
| Component: | Component-Logic | Assignee: | Sean Flanigan <sflaniga> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Zanata-QA Mailling List <zanata-qa> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 3.2 | CC: | dchen, zanata-bugs | ||||
| Target Milestone: | --- | ||||||
| Target Release: | 3.7 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | 3.7.0-SNAPSHOT (git-jenkins-zanata-server-github-pull-requests-3566) | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2015-07-22 02:20:07 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | 1198433 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
Created attachment 889199 [details]
Groovy script to check project homeContent for invalid SeamText
The attached Groovy script can check all the projects in a Zanata database for invalid SeamText. (It doesn't currently check Home or Help pages.)
From what I can see, about half the problems are caused by URLs which contain an odd number of underscores (underscores are used for _underlining_ in SeamText). These can be handled by wrapping the URL in pipe characters, eg:
|http://example.com/my_project_with_underscores|
These will then be rendered as-is in monospace (not clickable). They could also be converted to SeamText links like this:
[click me=>http://example.com/my_project_with_underscores]
Unfortunately, I didn't have any success constructing a working SeamText link whose link text was empty or the same as the URL.
In another case, a SeamText link was somehow corrupted, and the greater-than sign was encoded as '>' which SeamText doesn't like. Similarly, a quote character was converted to '''
Eliminating Seam Text should eliminate Seam Text parser errors: https://github.com/zanata/zanata-server/pull/732 VERIFIED with Zanata 3.7.0-SNAPSHOT (git-jenkins-zanata-server-github-pull-requests-3566) |
Description of problem: We're getting quite a number of these errors on translate.zanata.org's server.log: WARN [org.jboss.seam.ui.component.UIFormattedText] Seam Text parse error: expecting an opening angle bracket '<', found '&' We should write an ad-hoc Groovy script to trawl the database looking at all the Seam Text and run it through org.jboss.seam.ui.component.UIFormattedText.getFormattedText() or org.jboss.seam.ui.validator.FormattedTextValidator to work out what the problem is. Then if we can work out how to reproduce it, we should report a bug upstream, because the RichFaces editor should not be generating illegal Seam Text. However, we should try to find a way at least to avoid saving broken Seam Text when it has been generated. We might be able to use s:validateFormattedText inside rich:editor for that. Version-Release number of selected component (if applicable): 3.2, but (some of) the bad data may have been generated by an earlier version Additional info: These should be all the places in the JSF code which currently use Seam Text: $ cd server/zanata-war $ ack -A1 formattedText src/main/webapp src/main/webapp/project/project.xhtml 21: <s:formattedText id="project-home-content" 22- value="#{projectHome.instance.homeContent}"/> 23: <s:formattedText value="#{projectHome.instance.description}" 24- rendered="#{empty projectHome.instance.homeContent}"/> -- 34: <s:formattedText id="source-checkout-url" 35- rendered="#{not empty projectHome.instance.sourceCheckoutURL}" src/main/webapp/help/view.xhtml 16: <s:formattedText id="project-home-content" 17: value="#{applicationConfiguration.helpContent}"></s:formattedText> 18- </ui:define> src/main/webapp/home.xhtml 13: <s:formattedText id="project-home-content" 14: value="#{applicationConfiguration.homeContent}"></s:formattedText> 15- $ ack -A1 'rich:editor|useSeamText=.true.' src/main/webapp # and then remove any which don't have useSeamText src/main/webapp/WEB-INF/layout/project_edit_form.xhtml:94: <rich:editor id="homeContent" src/main/webapp/WEB-INF/layout/project_edit_form.xhtml-95- width="412" height="300" style="width:412px;" -- src/main/webapp/WEB-INF/layout/project_edit_form.xhtml:99: useSeamText="true" src/main/webapp/WEB-INF/layout/project_edit_form.xhtml-100- configuration="richeditor" -- src/main/webapp/WEB-INF/layout/project_edit_form.xhtml:102: </rich:editor> src/main/webapp/WEB-INF/layout/project_edit_form.xhtml-103- </s:decorate> -- src/main/webapp/help/edit_help_content.xhtml:20: <rich:editor id="homeContent" src/main/webapp/help/edit_help_content.xhtml-21- width="500" height="600" style="width:500px;" -- src/main/webapp/help/edit_help_content.xhtml:25: useSeamText="true" src/main/webapp/help/edit_help_content.xhtml-26- configuration="richeditor" -- src/main/webapp/help/edit_help_content.xhtml:28: </rich:editor> src/main/webapp/help/edit_help_content.xhtml-29- -- src/main/webapp/edit_home_content.xhtml:19: <rich:editor id="homeContent" src/main/webapp/edit_home_content.xhtml-20- height="600" -- src/main/webapp/edit_home_content.xhtml:24: useSeamText="true" src/main/webapp/edit_home_content.xhtml-25- configuration="richeditor" -- src/main/webapp/edit_home_content.xhtml:28: </rich:editor> src/main/webapp/edit_home_content.xhtml-29-