ryancramerdesign / ProcessWire

Our repository has moved to https://github.com/processwire – please head there for the latest version.
https://processwire.com
Other
727 stars 201 forks source link

Repeater with PageField only saves the first PageField #662

Open tobaco opened 10 years ago

tobaco commented 10 years ago

I have a repeater field with two text fields and a page field. When I add 2 or more rows (it's set up to prepare 5 rows at the start) and fill them with content (input text and select pages in the page field) it only saves the selected pages of the first page field and not the others. The text fields are fine an get saved as expected. Only the page fields from the second on are blank. When I look at the headers of the saving POST request, I see that the data (page ids for all the fields) get send to the server. What happens after that and where they get lost is out of my knowledge …

If I refill the empty page fields and save again, they get saved without problems …

I don't know if it's an issue with the repeater or the page fields but it's driving me and the others editors mad. It takes some time to find and select multiple pages and after saving, the fields are empty again.

I'm using the latest DEV version: ProcessWire 2.4.18 dev

tobaco commented 10 years ago

Some more information:

this also happens, after adding some more entries to already existing entries (not just on a fresh repeater). the first one saves the pagefield the the others not.

tobaco commented 9 years ago

as i slowly go crazy with this issue, i tried today for hours to debug this thing, but i can't figure out, where the values get lost. i looked at the Repeater module, the processPageEdit module, FieldtypePage module and lots of other places, but to no avail.

is there anything other i could do to help with this issue?

thanks.

ryancramerdesign commented 9 years ago

This sounds like an sql_mode issue to me. We've noticed some similar things elsewhere as a few people have started using MySQL 5.6 with different default sql_mode settings than in previous MySQL versions. I think that the current ProcessWire version (2.5.0 or 2.5.2 dev) should have this resolved, but please let me know if you are still experiencing it.

tobaco commented 9 years ago

thanks for looking into it! tried it just now on a 2.5.2 dev installation: no luck, same behaviour … :worried:

ryancramerdesign commented 9 years ago

I've setup the 2 text fields + 1 page field in a repeater here, then configured my sql_mode as strict as possible and still not duplicating the issue. So I think it's likely not an sql_mode thing now. Probably we have to look at 1) what other 3rd party modules do you have installed? and 2) what are the settings for your page field (i.e. what Inputfield is it using, is it single page or multi-page, etc.)? and 3) Do you see any change by adjusting your ready items (in repeater field settings) from 5 down to 3 or even 0?

ryancramerdesign commented 9 years ago

One other question would be what multi-language support you are using (if any) and whether the text fields in your repeater are multi-language or not (I was assuming not).

tobaco commented 9 years ago

thanks for your response! i have a lot of other modules activated, but i'll try to disable on after another and see, if something changes.

the pagefield is set up as MultipleSelectTransfer (accepts multiple pages) but it is the same problem with other types.

changing the number of ready items doesn't change it. only the page field in the first repeater get's saved.

i don't use multi-language fields.

tobaco commented 9 years ago

okeeee, i think i found the issue. i had (for whatever reasons …) a fieldcache field inside the repeater. when i removed this field, the page fields got saved without issue.

so this case here could be closed, unless you want to go after the reasons and need some more information to replicate the issue.

thanks for all your help and support and sorry for the hassle!

ryancramerdesign commented 9 years ago

Glad you found the issue. FieldtypeCache likely can't be compatible with repeaters at present. I'll have to add some kind of error to prevent the two from being used together.

On Tue, Sep 23, 2014 at 10:17 AM, Torsten Baldes notifications@github.com wrote:

okeeee, i think i found the issue. i had (for whatever reasons …) a fieldcache field inside the repeater. when i removed this field, the page fields got saved without issue.

so this case here could be closed, unless you want to go after the reasons and need some more information to replicate the issue.

thanks for all your help and support and sorry for the hassle!

— Reply to this email directly or view it on GitHub https://github.com/ryancramerdesign/ProcessWire/issues/662#issuecomment-56526211 .