404 Not Found error on Insert link in WYSIWYG


(K Dennis) #1

**Matrix Version:**5.5.3.1 also 5.5.5.0
In both versions attempting to use the WYSIWYG editor to insert link.generates a “404 Not Found” error.
There is no visible error message, but it can be seen in the developer tool network screen.
The OK button fails to respond.

here’s the entry from the log:

XHRundefined?SQ_ACTION=asset_tag_line&assetid=674

Here’s a clip from the Headers Tab of the developer screen:
Referer: https://www.firstline.com.au/__fudge/wysiwyg/plugins/matrix_insert_link/insert_link.php?assetid=0&url=http%3A%2F%2F&status_text=&link_title=&target=&new_window=0&new_window_options=<val_type>array<%2Fval_type> %20<name_type>string<%2Fname_type><name>toolbar<%2Fname><val_type>string<%2Fval_type><val><%2Fval> %20<name_type>string<%2Fname_type><name>menubar<%2Fname><val_type>string<%2Fval_type><val><%2Fval> %20<name_type>string<%2Fname_type><name>location<%2Fname><val_type>string<%2Fval_type><val><%2Fval> %20<name_type>string<%2Fname_type><name>status<%2Fname><val_type>string<%2Fval_type><val><%2Fval> %20<name_type>string<%2Fname_type><name>scrollbars<%2Fname><val_type>string<%2Fval_type><val><%2Fval> %20<name_type>string<%2Fname_type><name>resizable<%2Fname><val_type>string<%2Fval_type><val><%2Fval> %20<name_type>string<%2Fname_type><name>width<%2Fname><val_type>string<%2Fval_type><val><%2Fval> %20<name_type>string<%2Fname_type><name>height<%2Fname><val_type>string<%2Fval_type><val><%2Fval> &editor_name=bodycopy_866_content_type_wysiwyg_1512&in_popup=0&class_name=&id_name=

How can this be corrected?


(Bart Banda) #2

We need a bit more info on how to replicate to understand the issue. Can you share a step-by-step replication of what you are doing and how you are getting to the end result?


(K Dennis) #3

Here are the steps to replicate this problem:

Open the WYSIWYG editor in in a “content” screen after acquiring a lock
highlight a section of text.

click on the “Insert Link” Icon.
in the opened dialog click the “select asset” icon
In the asset map (inside the dialog) right click the target asset and choose “Use Me”
It populates the “select Asset” Field with the asset ID
but it does not populate the “Link” field.
and the OK button will not respond
Right click in the still open dialog and select “Inspect”
Open the Network Tab
Hit CTRL+R to record

and repeat the steps above from "click on the “Inset Link” Icon
now the network tab shows the 404 error

In earlier versions of squiz matrix choosing “Use Me” will populate both the “Select Asset” and “Link” Fields


(K Dennis) #4

We found a solution by making additions to the php file: /fudge/wysiwyg/plugins/matrix_insert_link/insert_link.php at about line 270.

 // Selected asset's type code
var asset_type = '';
if (f.elements["assetid[type_code]"] != undefined && f.elements["assetid[type_code]"].value != '') {
asset_type = f.elements["assetid[type_code]"].value;
} else if (f.elements["link_assetid[type_code]"] != undefined && f.elements["link_assetid[type_code]"].value != '') {
asset_type = f.elements["link_assetid[type_code]"].value;
} else if (f.elements["page_redirect_assetid[type_code]"] != undefined && f.elements["page_redirect_assetid[type_code]"].value != '') {
asset_type = f.elements["page_redirect_assetid[type_code]"].value;
}
if (asset_type != '') {
// Disable the irrelevant asset type option based on the currently selected asset

This is what has been added

]"] != undefined && f.elements["assetid[type_code

]"] != undefined && f.elements["link_assetid[type_code

]"] != undefined && f.elements["page_redirect_assetid[type_code

After making the changes, the OK button could be clicked and the link is inserted into the HTML


(Bart Banda) #5

Thanks Dennis, good to hear you found a workaround.
We’re looking to replace the classic WYSIWYG with Viper WYSIWYG for Matrix 6 so we probably won’t bother porting this fix back to core before that release.