New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes to MLRepeater for nested repeater usage #409
Conversation
Just to tie this all together was there a PR to the test plugin to demonstrate the issue and prove a fix for the issue across both MLRepeater and the base Repeater? |
That's definitely the next step. |
Nice work ! I have a site with many nested, grouped, and ML repeaters using StaticPages on which to test it. There's only 2 issues I could see but these are not breaking bugs IMO. See video demonstrating the problems: http://take.ms/WU53rb
I already encountered 1. (or at least something close) before this PR so I think it's not a regression of this fix. That said, I don't realy know how to qualify this (bug or feature ?) because it's sometimes useful to copy the original content when translating. For 2. it seems only related to repeater groups: I also tested with a simple repeater made of one text field and there's no problem with deleting the last item. |
@Fl0Cri Thanks for giving this another set of eyes. I also ran into (2) when doing some further testing. That'll be applicable to the core change to getting the repeater save value through the child form widgets. I don't have a solution quite yet though. I'll look into (1) as well and see what's going on there. Thanks! |
@Fl0Cri I think I've worked out the issues that were occurring if you wouldn't mind taking another look at the latest versions of this and the core PR. |
Ok, (1) seems to be gone with your fix. But (2) is still here for languages that are not the main language. I've also found a variant of (1), let's call it (1.2). It occurs with nested repeaters Here's a video to show this bug and the repeaters deletion problem: http://take.ms/bDKyv To reproduce 1.2:
Comments about 2:
My simplified layout I used for the video:
description = "Test repeater"
[localePicker]
forceUrl = 1
[staticPage]
useContent = 0
default = 0
==
{repeater name="sections" groups="themes/.../meta/sections-repeater.yaml" tab="Sections"}
{# parser fail if there is noting between open and close tag #}
{/repeater}
<!DOCTYPE html>
<html>
<head></head>
<body>
{% for section in sections %}
<section>
{% if section._group == 'simple' %}
<h2>{{ section.title }}</h2>
{{ section.content | raw }}
{% elseif section._group == 'grid' %}
<h2>{{ section.title }}</h2>
<div class="row">
{% for block in section.blocks %}
<div class="col-md-6">
{{ block.content | raw }}
</div>
{% endfor %}
</div>
{% endif %}
</section>
{% endfor %}
</body>
</html>
simple:
name: Simple
description: 'Full width text'
icon: icon-paragraph
fields:
title:
type: text
label: Title
span: left
content:
type: richeditor
label: Content
span: full
grid:
name: Grid
description: 'A grid of text blocks'
icon: icon-paragraph
fields:
title:
type: text
label: Title
span: left
blocks:
type: repeater
label: Grid
span: full
form:
fields:
content:
type: richeditor
label: Content |
Small update: because I made a clean install to test #416 I've also made my tests again with these PR and I get the same results (tested with Chrome and FireFox). Can someone reproduce it? |
This needs to be re-evaluated in lite of octobercms/october#4234 and #466 |
Not ready to be merged yet, but I'm submitting so it's easy for others to test and comment on. This applies to #307, which I've apparently duplicated effort on.
Note that this is in combination with octobercms/october#3729, so any testing should have that applied to core.