FireWire Posted 6 hours ago Share Posted 6 hours ago This may be an issue when using the ProFields Custom Field. I have a block that contains a Custom Field. That custom field contains a Page Reference field (single), Page Reference field (multiple), and a number input. When I create several blocks containing this field the values become unmanageable. They all appear in all blocks and can't be ordered in any of them. I have several of these blocks and each should have only 3 or 4, but they are all rendered with all of them. I did do some digging and found that the custom fields are not prefixed as a repeater field in the request data when saving the page, so each of these Page Reference field with multiple pages selected are all returned as a single variable array. I've attached a txt file with the POST request parameters and it shows the following variable repeated without a repeater suffix: event_activities_select_activities[] Which may need to be handled as something like: event_activities_select_activities_repeater5783[] This is just a guess... I could be off on that, but the only constant that I could see in the issues when rendering is that every block has the same event_activities_select_activities variable without a way for it to be processed individually by block. That's what I could pull together while experimenting. Something that's fixable? I have to determine if I need to rewrite the blocks to use different fields 😵💫 rpb_blocks_custom_fields_request.txt Link to comment Share on other sites More sharing options...
gebeer Posted 3 hours ago Share Posted 3 hours ago The list of currently supported inputfield types under heading "Possible values for “type”" at https://processwire.com/blog/posts/custom-fields-module/ does not list AsmSelect which you chose for your page field (multiple) based on the screenshots. Maybe this is the issue? Have you tried field type SelectMultiple instead of AsmSelect? 1 Link to comment Share on other sites More sharing options...
FireWire Posted 3 hours ago Author Share Posted 3 hours ago @gebeer Was a good idea to double check, in the example documentation in the module it shows compatibility. I do see AsmSelect in the list of approved fields on that blog post. <?php /** * Page reference fields * * All Page reference Inputfields need to have at least the following * properties defined: * * - `derefAsPage` (int): Whether it single or multiple mode: * * - `0`: Multiple page (PageArray). * - `1`: Single Page or NULL when empty. * - `2`: Single Page or NullPage when empty. * * - `inputfield` (string): Which input class to use, can be any of the following. * You can specify the Inputfield class name or optionally omit the `Inputfield` * prefix, like the options below: * * - `select`: Select one via standard select. * - `selectMultiple`: Select multiple via multiline select. * - `radios`: Select one via radio buttons. * - `checkboxes`: Select multiple via checkboxes. * - `asmSelect`: Select multiple/sortable via asmSelect. * - `pageAutocomplete`: Autocomplete for single or multiple selection. * - `pageListSelect`: Select one page from tree. * - `pageListSelectMultiple`: Select multiple pages from tree. * - `textTags`: Select one or multiple via text tags input. * */ I also tested it in a vanilla repeater field and wasn't able to replicate the issue there. Using the field in a repeater applies a unique suffix: event_activities_select_repeater5720_activities[] 1 Link to comment Share on other sites More sharing options...
gebeer Posted 3 hours ago Share Posted 3 hours ago @FireWiresorry, I totally did not see AsmSelect in the list albeit it being the very first item. Strange things happen sometimes... 1 Link to comment Share on other sites More sharing options...
FireWire Posted 3 hours ago Author Share Posted 3 hours ago No worries at all, I always figure that if something gets posted in the forums it will end up helping someone! 1 Link to comment Share on other sites More sharing options...
bernhard Posted 2 hours ago Share Posted 2 hours ago Hey @FireWire sorry for the trouble. I don't have any experience with this field and I have to focus on RockCommerce until December, so don't expect a quick solution. From your request it looks like you have a load of data sent, so I guess this is related to your post saying that you had to increase the max input variables setting of your server? When using the Frontend for editing this is not an issue. Can you confirm that? Can you also confirm that when clicking the "edit this block in a new window" on the backend it is possible to edit the block as expected? ...Because I'm thinking of maybe adding an option for blocks to prevent direct editing and only show a button to edit them in a modal popup. I think that could solve such issues in a common way. Link to comment Share on other sites More sharing options...
FireWire Posted 2 hours ago Author Share Posted 2 hours ago @bernhard It was on the same page but addressed an overall issue where the page wasn't saving. I upped the max input variables to 2000 and the page started saving again. I haven't been using the front end editor due to the workflow and jumping around in the admin. Admittedly, I think the max input vars and this was a perfect storm or I probably would have seen it sooner, one covered up the other. I'll figure an alternative out. Using a custom field isn't a requirement. This post may help others in the meantime though. But this one is kinda on me... Ryan: Me: WELL I BETTER GO USE THIS IN PRODUCTION RIGHT AWAY! Link to comment Share on other sites More sharing options...
bernhard Posted 2 hours ago Share Posted 2 hours ago 19 minutes ago, bernhard said: Can you also confirm that when clicking the "edit this block in a new window" on the backend it is possible to edit the block as expected? ...Because I'm thinking of maybe adding an option for blocks to prevent direct editing and only show a button to edit them in a modal popup. I think that could solve such issues in a common way. ? 1 Link to comment Share on other sites More sharing options...
FireWire Posted 1 hour ago Author Share Posted 1 hour ago @bernhard Sorry, it's 2:40am here and I'm migrating servers. My brain is a little fried and I misread what you typed. I'll check it out when I can. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now