[
http://jira.magnolia-cms.com/browse/MAGNOLIA-2768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=24282#action_24282
]
Grégory Joseph commented on MAGNOLIA-2768:
------------------------------------------
This could be another feature if we wanted, but the context here is when
rendering text in fckeditor; we can't "hide" the links here - it's actually
rendering the broken link "on purpose", so that the editor can fix the link.
When rendering links "on pages", yes, we could do something like what you
propose. See linked issue for further improvements to the links api.
> NPE on link replacement for invalid links in fckedit
> ----------------------------------------------------
>
> Key: MAGNOLIA-2768
> URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-2768
> Project: Magnolia
> Issue Type: Bug
> Components: fckeditor
> Reporter: Fabrizio Giustina
> Assignee: Grégory Joseph
> Priority: Minor
> Fix For: 4.1.1
>
>
> This happened with a link to a resource not existing anymore in the dms
> repository, although it can't be reproduced easily:
> {noformat}
> java.lang.NullPointerException
> at java.util.regex.Matcher.getTextLength(Unknown Source)
> at java.util.regex.Matcher.reset(Unknown Source)
> at java.util.regex.Matcher.<init>(Unknown Source)
> at java.util.regex.Pattern.matcher(Unknown Source)
> at
> info.magnolia.module.fckeditor.dialogs.FckEditorDialog.convertToView(FckEditorDialog.java:407)
> at
> info.magnolia.module.fckeditor.dialogs.FckEditorDialog.drawHtml(FckEditorDialog.java:281)
> at
> info.magnolia.cms.gui.dialog.DialogControlImpl.drawSubs(DialogControlImpl.java:322)
> at
> info.magnolia.cms.gui.dialog.DialogControlImpl.drawHtml(DialogControlImpl.java:166)
> {noformat}
> fckedit crashes during link resolving and the dialog can't be open anymore.
> Looking at the code it seems LinkUtil.convertUUIDsToEditorLinks(value)
> returns a null value and the following regexp fails:
> {code:java}
> public String convertToView(String value) {
> if (value != null) {
> // we have to add the context path for images and files but not
> for pages!
> value = LinkUtil.convertUUIDsToEditorLinks(value);
> // this section is for backward compatibility - see MAGNOLIA-2088
> final Matcher matcher =
> LinkHelper.LINK_OR_IMAGE_PATTERN.matcher(value);
> {code}
> it may worth to add a simple null check before the additional replacement...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------