I'm having an issue with the IPE only on regions on a row with multiple columns. I have a custom layout that looks like this:

Title
ContentHeader
Content1 Content2
Content3 Content4
ContentFooter
Footer1 Footer2 Footer3

If I use the IPE to edit content, it works on all the regions.
If I use the IPE to Add / Edit / Move a pane in Title, ContentHeader, and ContentFooter there are no problems as well.
However, if I use the IPE to Add / Edit / Move a pane in Content1,Content2,Content3,Content4,Footer1,Footer2, or Footer3, everything works as expected and I see the new content after Saving but if I reload the page the changes are gone.

I had the 7.x-3.0-alpha3 version installed when I created these pages. I updated the module to 7.x-3.x-dev and it still has the same issue. I also tried refreshing the cache and I tried making a new page and I'm still having the issue.

Please let me know if you need any additional info. Thanks.

CommentFileSizeAuthor
#8 panels-1396600-8.patch711 byteshaiiro.shimeji

Comments

merlinofchaos’s picture

How are your regions named in the layout?

IPE has problems with dashes in region names, this is a known issue with some custom layouts.

jesmaster’s picture

None of them have dashes but some of them have spaces.

merlinofchaos’s picture

Spaces are definitely invalid in the region names (not the titles, just the internal name). I'm surprised that the layouts work at all.

jesmaster’s picture

I believe the spaces are only in the title. Here is the settings from the MySQL database for one of my layouts. It looks like the internal name has an underscore wherever the title has a space.

a:1:{s:5:"items";a:32:{s:6:"canvas";a:13:{s:4:"type";s:3:"row";s:8:"contains";s:6:"column";s:8:"children";a:1:{i:0;i:1;}s:6:"parent";N;s:5:"class";s:0:"";s:12:"column_class";s:0:"";s:9:"row_class";s:0:"";s:12:"region_class";s:15:"company_content";s:8:"no_scale";b:0;s:11:"fixed_width";s:0:"";s:17:"column_separation";s:5:"1.5em";s:17:"region_separation";s:0:"";s:14:"row_separation";s:0:"";}i:1;a:6:{s:4:"type";s:6:"column";s:5:"width";i:100;s:10:"width_type";s:1:"%";s:6:"parent";s:6:"canvas";s:8:"children";a:6:{i:0;i:19;i:1;i:9;i:2;i:3;i:3;i:14;i:4;i:20;i:5;i:21;}s:5:"class";s:26:".company_page_title_column";}i:3;a:5:{s:4:"type";s:3:"row";s:8:"contains";s:6:"column";s:8:"children";a:2:{i:0;i:7;i:1;i:8;}s:6:"parent";s:1:"1";s:5:"class";s:29:"company_content_border_bottom";}i:7;a:6:{s:4:"type";s:6:"column";s:5:"width";s:18:"37.884055680665846";s:10:"width_type";s:1:"%";s:6:"parent";s:1:"3";s:8:"children";a:1:{i:0;i:10;}s:5:"class";s:51:"company_content_border_right company_content_column";}i:8;a:6:{s:4:"type";s:6:"column";s:5:"width";s:18:"62.115944319334154";s:10:"width_type";s:1:"%";s:6:"parent";s:1:"3";s:8:"children";a:1:{i:0;i:12;}s:5:"class";s:22:"company_content_column";}i:9;a:5:{s:4:"type";s:3:"row";s:8:"contains";s:6:"region";s:8:"children";a:1:{i:0;s:6:"header";}s:6:"parent";s:1:"1";s:5:"class";s:29:"company_content_border_bottom";}s:6:"header";a:6:{s:4:"type";s:6:"region";s:5:"title";s:6:"Header";s:5:"width";i:100;s:10:"width_type";s:1:"%";s:6:"parent";s:1:"9";s:5:"class";s:4:"left";}i:10;a:5:{s:4:"type";s:3:"row";s:8:"contains";s:6:"region";s:8:"children";a:1:{i:0;s:8:"top_left";}s:6:"parent";s:1:"7";s:5:"class";s:0:"";}i:12;a:5:{s:4:"type";s:3:"row";s:8:"contains";s:6:"region";s:8:"children";a:1:{i:0;s:9:"top_right";}s:6:"parent";s:1:"8";s:5:"class";s:0:"";}s:8:"top_left";a:6:{s:4:"type";s:6:"region";s:5:"title";s:8:"Top Left";s:5:"width";i:100;s:10:"width_type";s:1:"%";s:6:"parent";s:2:"10";s:5:"class";s:0:"";}s:9:"top_right";a:6:{s:4:"type";s:6:"region";s:5:"title";s:9:"Top Right";s:5:"width";i:100;s:10:"width_type";s:1:"%";s:6:"parent";s:2:"12";s:5:"class";s:0:"";}i:14;a:5:{s:4:"type";s:3:"row";s:8:"contains";s:6:"column";s:8:"children";a:2:{i:0;i:15;i:1;i:16;}s:6:"parent";s:1:"1";s:5:"class";s:29:"company_content_border_bottom";}i:15;a:6:{s:4:"type";s:6:"column";s:5:"width";s:18:"62.115944319334154";s:10:"width_type";s:1:"%";s:6:"parent";s:2:"14";s:8:"children";a:1:{i:0;i:17;}s:5:"class";s:51:"company_content_border_right company_content_column";}i:16;a:6:{s:4:"type";s:6:"column";s:5:"width";s:18:"37.884055680665846";s:10:"width_type";s:1:"%";s:6:"parent";s:2:"14";s:8:"children";a:1:{i:0;i:18;}s:5:"class";s:22:"company_content_column";}i:17;a:5:{s:4:"type";s:3:"row";s:8:"contains";s:6:"region";s:8:"children";a:1:{i:0;s:11:"bottom_left";}s:6:"parent";s:2:"15";s:5:"class";s:0:"";}s:11:"bottom_left";a:6:{s:4:"type";s:6:"region";s:5:"title";s:11:"Bottom Left";s:5:"width";i:100;s:10:"width_type";s:1:"%";s:6:"parent";s:2:"17";s:5:"class";s:0:"";}i:18;a:5:{s:4:"type";s:3:"row";s:8:"contains";s:6:"region";s:8:"children";a:1:{i:0;s:12:"bottom_right";}s:6:"parent";s:2:"16";s:5:"class";s:0:"";}s:12:"bottom_right";a:6:{s:4:"type";s:6:"region";s:5:"title";s:12:"Bottom Right";s:5:"width";i:100;s:10:"width_type";s:1:"%";s:6:"parent";s:2:"18";s:5:"class";s:0:"";}i:19;a:5:{s:4:"type";s:3:"row";s:8:"contains";s:6:"region";s:8:"children";a:1:{i:0;s:5:"title";}s:6:"parent";s:1:"1";s:5:"class";s:0:"";}s:5:"title";a:6:{s:4:"type";s:6:"region";s:5:"title";s:5:"Title";s:5:"width";i:100;s:10:"width_type";s:1:"%";s:6:"parent";s:2:"19";s:5:"class";s:20:"company_title_region";}i:20;a:5:{s:4:"type";s:3:"row";s:8:"contains";s:6:"region";s:8:"children";a:1:{i:0;s:6:"footer";}s:6:"parent";s:1:"1";s:5:"class";s:29:"company_content_border_bottom";}s:6:"footer";a:6:{s:4:"type";s:6:"region";s:5:"title";s:6:"Footer";s:5:"width";i:100;s:10:"width_type";s:1:"%";s:6:"parent";s:2:"20";s:5:"class";s:0:"";}i:21;a:5:{s:4:"type";s:3:"row";s:8:"contains";s:6:"column";s:8:"children";a:3:{i:0;i:23;i:1;i:22;i:2;i:24;}s:6:"parent";s:1:"1";s:5:"class";s:18:"company_footer_row";}i:22;a:6:{s:4:"type";s:6:"column";s:5:"width";s:18:"33.135867537315036";s:10:"width_type";s:1:"%";s:6:"parent";s:2:"21";s:8:"children";a:1:{i:0;i:26;}s:5:"class";s:0:"";}i:23;a:6:{s:4:"type";s:6:"column";s:5:"width";s:17:"33.20887934008404";s:10:"width_type";s:1:"%";s:6:"parent";s:2:"21";s:8:"children";a:1:{i:0;i:25;}s:5:"class";s:0:"";}i:24;a:6:{s:4:"type";s:6:"column";s:5:"width";s:17:"33.65525312260092";s:10:"width_type";s:1:"%";s:6:"parent";s:2:"21";s:8:"children";a:1:{i:0;i:27;}s:5:"class";s:0:"";}i:25;a:5:{s:4:"type";s:3:"row";s:8:"contains";s:6:"region";s:8:"children";a:1:{i:0;s:18:"footer_bottom_left";}s:6:"parent";s:2:"23";s:5:"class";s:0:"";}s:18:"footer_bottom_left";a:6:{s:4:"type";s:6:"region";s:5:"title";s:18:"Footer Bottom Left";s:5:"width";i:100;s:10:"width_type";s:1:"%";s:6:"parent";s:2:"25";s:5:"class";s:0:"";}i:26;a:5:{s:4:"type";s:3:"row";s:8:"contains";s:6:"region";s:8:"children";a:1:{i:0;s:13:"footer_middle";}s:6:"parent";s:2:"22";s:5:"class";s:0:"";}s:13:"footer_middle";a:6:{s:4:"type";s:6:"region";s:5:"title";s:13:"Footer Middle";s:5:"width";i:100;s:10:"width_type";s:1:"%";s:6:"parent";s:2:"26";s:5:"class";s:0:"";}i:27;a:5:{s:4:"type";s:3:"row";s:8:"contains";s:6:"region";s:8:"children";a:1:{i:0;s:19:"footer_bottom_right";}s:6:"parent";s:2:"24";s:5:"class";s:0:"";}s:19:"footer_bottom_right";a:6:{s:4:"type";s:6:"region";s:5:"title";s:19:"Footer Bottom Right";s:5:"width";i:100;s:10:"width_type";s:1:"%";s:6:"parent";s:2:"27";s:5:"class";s:0:"";}}}

haiiro.shimeji’s picture

Under bar ('_') is also the invalid character for region name (inner name).
If you set the title with some spaces or multibyte characters when create the region, the inner name of the region includes under bar.
( these characters will be replaced underbars ).

To solve the problem, create new regions with the title includes no white space and move the all blocks to the new region, then delete the old regions.

merlinofchaos’s picture

I believe the problem with the underscore is fixed, but we're still broken with dashes.

haiiro.shimeji’s picture

I wonder Jesmaster's problem is about the region name includes white space (this is replaced as underscore in inner name).

I tried again with the current code in the git repository, but the problem is still remained.

・I created two regions named as "Left region" and "Right region", and place panes to the each regions,
・These regions are named as "left_region" and "right_region" in panels_display table.
・And I moved the pane in Right region to Left region in In-Place-Editor.
・Submit, but the change is not saved.



the function DrupalPanelsIPE.saveEditing in panel_ipe.js line 267.

      $('input[name="panel[pane][' +  region + ']"]', ipe.control).val(val);

This "region" variable is the region name whose white spaces are replaced by hyphen '-' ( left-region etc. ).
But the input elements created are named as the region name white spaces are replaced by underscore '_' ( left_region ).
So the above code has no effect, and the layout changes won't be saved.


We should unify how a white space is treated as a hyphen or as a underscore.
The database table treats a white space as a underscore, so i wonder it is good to follow this matter.

Ctools sanitize function replaces underscores to hyphens.
This behavior is restrained by options.

haiiro.shimeji’s picture

StatusFileSize
new711 bytes

Ctools replaces underscores in id of html elements.
This patch restrains this behavior.

merlinofchaos’s picture

Status: Active » Needs review

I'm not completely sure we need the cleanstring at all; the backend editor, for example, doesn't use it.

We could potentially just eliminate it.

Also, please use proper coding style. You're missing spaces. :)

And when attaching patches, please use the status 'needs review' to make it more likely they'll be found.

sdboyer’s picture

yeah, we can simply pull out the cleanstring. there's no need for it.

haiiro.shimeji’s picture

ok, I agree. I think that there is no necessity for correction.
It is not necessary to take a security risk for a restrictive situation.

Also, please use proper coding style. You're missing spaces. :)
And when attaching patches, please use the status 'needs review' to make it more likely they'll be found.

Sorry, I'll be careful.

sdboyer’s picture

Status: Needs review » Fixed

Commushed that change. My tests weren't completely exhaustive this time around, but I tested it before and it worked well enough. We can re-open if the problem persists.

sdboyer’s picture

Status: Fixed » Needs work

...and, reverted that change. seems it broke adding of new panes in certain circumstances. unfortunately, it made it into the 3.1 release :(

sdboyer’s picture

Status: Needs work » Fixed

there was a small, boneheaded oversight i made - i ended up unassigning the variable used to fill the target region id for adding the pane. thus, it never got added from the add content modal.

fixed now.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 0d3a102 on 7.x-3.x, 7.x-3.x-i18n, 8.x-3.x by sdboyer:
    Proper, non-boneheaded fix for #1396600.
    
    
  • Commit a819238 on 7.x-3.x, 7.x-3.x-i18n, 8.x-3.x by sdboyer:
    Revert "Issue #1396600: Fixed IPE Add / Delete / Move not working on...
  • Commit fa6d4ba on 7.x-3.x, 7.x-3.x-i18n, 8.x-3.x by sdboyer:
    Issue #1396600: Fixed IPE Add / Delete / Move not working on regions...