Closed (fixed)
Project:
Webform
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
28 Oct 2016 at 21:11 UTC
Updated:
28 Nov 2016 at 18:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
liam morlandComment #3
danchadwick commentedI am pretty sure, but not 100% sure, that the page name (i.e. "label" in the UI) is intended only as a reference to the page. It can be any unique identifier. In this way, the code freely makes them unique by appending "_X" where X is a number.
In the situation you cite, would be possible to still have name conflicts. Suppose you have two identically-named pages "1". The first one would get renamed "1 " (with a space appended). The second one would also get the same name because there is no page name "1" yet in the array being built.
I suggest that the initial attempt for page names always have " " appended, as in:
What I don't know is which, if any, of the affected calls to webform_component_list with $pagebreak_groups == TRUE could be negatively affected. I would hope none. Conditionals seem okay.
Comment #4
liam morlandGood point about the space being added before the uniqueness check.
I don't think the space needs to be added except in the rare situations where the name is only digits.
Comment #5
liam morlandThis improves the test as well, testing for a page break with the same name as another page break.
Comment #6
liam morlandWith debugging code removed.
Comment #8
liam morland