-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hi,
I am having an issue with the Frontend Editing module:
The module wire/modules/Page/PageFrontEdit/PageFrontEdit.module have the following on the function hookPageRender:
// loine: 431
if(strpos($out, "id=pw-edit-") === false && !$hasEditTags && !$hasEditAttr) return;This line is only checking for the string "id=pw-edit-" and do not check for 'id="pw-edit-' so in some pages do render/load all the necessary html, css and javascript to be possible to edit the pages on the frontend.
In my case, I am using the Multi Language Profile. The Summary field is used to create the meta description and the following is what happens if the Summary is empty or not:
- If empty: It isn't possible to edit the body. The necessary html to edit the
Summaryfield is not rendered even if the html necessary to edit theBodyis present on the page. - If not empty: It is possible to edit the
Bodyand the necessary html to edit theSummaryfield is rendered
If the Summary is empty, only renders:
<meta name="description" content="">And it can't find the string id=pw-edit-and because of that is not possible to edit the other fields like the Body.
If the Summary is not empty, renders:
<meta name="description" content="<div id=pw-edit-5 class='pw-edit pw-edit-InputfieldTextarea' data-name=summary data-page=1167 data-lang='1035' style='position:relative'><div class=pw-edit-orig>Aperçu du blog.</div><div class=pw-edit-copy id=pw-editor-summary-1167 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>Aperçu du blog.</div></div>" />It is possible to edit the Bodyon the frontend.
To try to fix this, the only way I found was to patched the wire/modules/Page/PageFrontEdit/PageFrontEdit.module with the following:
- ORIGINAL:
if(strpos($out, "id=pw-edit-") === false && !$hasEditTags && !$hasEditAttr) return; - PATCH:
if((strpos($out, "id=pw-edit-") === false && strpos($out, 'id="pw-edit-') === false) && !$hasEditTags && !$hasEditAttr) return;
With this patch it works even if the Summary is empty.
I don't know if I am doing something wrong with this approach or not but I would like to have a solution for this.
@ryancramerdesign, it is possible for you to look into this?
I am starting a new project and this is critical.
Thank you.