[MAGNOLIA-2091] Image Linking Broken in FCKEditor Created: 18/Mar/08  Updated: 23/Jan/13  Resolved: 10/Jul/08

Status: Closed
Project: Magnolia
Component/s: fckeditor
Affects Version/s: 3.5.4
Fix Version/s: 3.6, 3.5.9

Type: Bug Priority: Major
Reporter: Sean McMains Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MAGNOLIA-2192 FckEditor: add possibilty to "browse ... Closed
is related to MAGNOLIA-2193 FckEditor : insert image : the link t... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

To reproduce:

  1. Create a new Samples: Editor paragraph
  2. Within the FCKEditor pane, click the "Insert/Edit Image" button
  3. The "Image Properties" window appears
  4. Click the "Link" tab
  5. Click the "Browse Server" button
  6. Select "Website" from the "Content" popup
  7. Select a page from the site hierarchy
  8. Click "OK"

Expected behavior:

  • Image should be linked to selected page

Actual behavior:

  • Popup throws javascript error, is not closed. (Error is: opener.document.getElementById("cmbLinkProtocol") has no properties
    opener.document.getElementById('cmbLinkProtocol').value = ''


 Comments   
Comment by Magnolia International [ 19/Mar/08 ]

confirmed: wether you upload an image first or not, the "browse server" popup does not close itself and stays opened with the "Setting URI..." message.
However, the link is apparently set properly, so apart from the annoyance of having to manually close the popup, the link functionality itself is not broken.

Comment by Sean McMains [ 25/Jun/08 ]

While I agree that removing the Link tab is ultimately the best way to deal with this, here's a quick patch to make it work as-is:

Index: magnolia-editor-fckeditor/src/main/resources/info/magnolia/module/fckeditor/pages/RepositoryBrowserPageSubmit.html
===================================================================
--- magnolia-editor-fckeditor/src/main/resources/info/magnolia/module/fckeditor/pages/RepositoryBrowserPageSubmit.html	(revision 2829)
+++ magnolia-editor-fckeditor/src/main/resources/info/magnolia/module/fckeditor/pages/RepositoryBrowserPageSubmit.html	(revision 2830)
@@ -10,7 +10,9 @@
       // <!-- 
         function setURI() {
           opener.SetUrl("${this.absoluteURI}");
-          opener.document.getElementById('cmbLinkProtocol').value = '';
+          if ( opener.document.getElementById('cmbLinkProtocol') != null ) {
+          	opener.document.getElementById('cmbLinkProtocol').value = '';
+          }
           window.top.close();
         }
       // -->
Comment by Magnolia International [ 25/Jun/08 ]

Thanks Sean !

Comment by Magnolia International [ 10/Jul/08 ]

Thanks, patch applied on both trunk (3.6) and 3.5 branch !
I'd be curious to understand what exactly is happening here though, and if there's a reason to set that value to '' at all.

Comment by Sean McMains [ 10/Jul/08 ]

The same function is used for linking from the image link tab and for the link button in FCK Editor. In the former case, there's no protocol popup, since the protocol will be whatever the site visitor is already using. In the latter case, since one can use the link button to link to external URLs, there's a popup that lets you set http, https, or "other". Setting the value to '' sets that menu to the "other" setting to ensure that it's treated as an internal link.

Comment by Magnolia International [ 10/Jul/08 ]

wow, thanks for the explanations goes saying how much i know about our current gui code when Philipp isn't around

Generated at Mon Feb 12 03:33:19 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.