Skip to content
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

Repeater item labels not displayed for nested Repeaters #173

Closed
Toutouwai opened this issue Jan 27, 2017 · 12 comments
Closed

Repeater item labels not displayed for nested Repeaters #173

Toutouwai opened this issue Jan 27, 2017 · 12 comments

Comments

@Toutouwai
Copy link

Toutouwai commented Jan 27, 2017

Short description of the issue

If a Repeater is nested inside another Repeater, any custom item label for the nested repeater isn't displayed: the name/title of the nested repeater field is displayed instead.

Optional: Screenshots/Links that demonstrate the issue

2017-01-27_144236
2017-01-27_144118

Steps to reproduce the issue

  1. Place a Repeater field inside another Repeater field.
  2. Check nested Repeater label in Page Edit.

Setup/Environment

  • ProcessWire version: 3.0.50
  • (Optional) PHP version: 7
@Toutouwai Toutouwai changed the title Repeater item labels don't work for nested Repeaters Repeater item labels not displayed for nested Repeaters Jan 27, 2017
@ryancramerdesign
Copy link
Member

I can't duplicate this one. My nested repeater has the proper label. However, I see in your screenshot that the nested repeater label is "Test nested repeater" and the title is "Green" – what's going on there? Does this repeater item just need to be saved?

@Toutouwai
Copy link
Author

However, I see in your screenshot that the nested repeater label is "Test nested repeater" and the title is "Green" – what's going on there? Does this repeater item just need to be saved?

This is the bug that I am describing here. The repeater item label should be "Green (Round)" but instead the repeater item label shows the label of the repeater field itself. The repeater item has been saved.

I can reproduce this issue on fresh PW 3.0.51 installation. I have a demo site online I can give you access to if that helps.

@ryancramerdesign
Copy link
Member

Just tried again after changing my label format and field names to be the same as yours, but still can't duplicate it. What are your repeater settings for both repeaters for these?

  • Repeater item visibility in editor?
  • Repeater dynamic loading (AJAX) in editor
  • Remember which repeater items are open?
  • Use accordion mode?

My settings are the defaults for all of these, which for the first 2 (radio buttons) means the first item is checked, and for the second two (checkboxes) means neither is checked.

@Toutouwai
Copy link
Author

My two repeater fields have the default settings for everything apart from the "Repeater items labels" setting. In the simplified demo shown below, the setting for both repeaters is {title}. I will PM you via the forum with access details for this demo installation.

2017-02-04_105744

@AndZyk
Copy link

AndZyk commented Jun 18, 2017

I recently experienced this issue and avoided it by disabling "Repeater dynamic loading (AJAX) in editor" for the parent repeater field.

@ethanbeyer
Copy link

I recently bumped an installation from 3.0.42 to 3.0.62 and found this issue - and like @AndZyk, I was able to "fix" the issue by disabling "Repeater dynamic loading (AJAX) in editor" for the parent.

The console prints: Empty string passed to getElementById().

screen shot 2017-06-27 at 16 23 13

@Toutouwai
Copy link
Author

Toutouwai commented Jul 8, 2017

I have tracked this problem back to this commit.

The problematic part seems to be that $allowRender is declared with the "static" keyword. So when a nested repeater item label is rendered $allowRender can already be "false" from when a previous repeater item called the function.

Not sure why the variable should be static - shouldn't it be evaluated to true or false freshly each time the renderRepeaterLabel() method is called?

Removing the static keyword seems to fix the issue.

@justb3a
Copy link

justb3a commented Sep 14, 2017

+1. Disabling "Repeater dynamic loading (AJAX) in editor" for the parent repeater field solved the issue as mentioned above.

ProcessWire 3.0.74

@ethanbeyer
Copy link

Is this commit in any of the dev builds?

@adrianbj
Copy link

adrianbj commented Feb 7, 2018

Is this commit in any of the dev builds?

There is the one Ryan just referenced above - is that what you are looking for?

@Toutouwai
Copy link
Author

Thanks for the fix.

@ethanbeyer
Copy link

screen shot 2018-02-07 at 15 41 48

@adrianbj sorry, I should've looked harder! I wasn't sure if it had been pulled into the dev branch with a new version number. I see that it's apart of 3.0.90!

💃

thanks, @ryancramerdesign!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants