In Progress

Nested repeater crashing inside greenlight raw query data source loop + Some quirks and use cases with query loop and visibility conditions

5

I am trying to build a UL > LI prining page with each Price Item being LI containing repeater of price options.

Here is my raw query

{
“posts_per_page”: “5”,
“post_type”: “price_item”,
“tax_query_relation”: “OR”,
“tax_query”: [
{
“taxonomy”: “service_category”,
“field”: “id”,
“terms”: “106”,
“operator”: “IN”
},
{
“taxonomy”: “service_category”,
“field”: “id”,
“terms”: “106, 114”,
“operator”: “AND”
}
],
“order”: “ASC”
}

It fetches exactly the CPTs that I want, and I am able to use flat inner fields. But once I try to use Repeater – block crashes instantly.

What I did:
1. Created UL loop with query as source.
2. Mapped txt field inside, and added div with data source DYNAMIC
3. Setting up div I tried to choose: ACPT repeater (Nothing happens and no data available when I use repeater field key), Custom Meta Field Repeater (nothing happens here either), Nested Repeater Field (corretctly shows available fields, but block crashes when I input the repeater key).
4. My repeater has 4 key-value pairs: text, radio, text and text. Sometimes text field is empty when it is not requiered by the price item. I wish I could also use visibility condition to hide empty repeater values from rendering, but at this point I cant even show any.

My use case is having a list of dynamic cards filtered by category and ordered by date + list of inner items inside each card. It could be repeater or flexible data – but the case is very much needed for rental cards, pricing, service details, event details etc.

Other additional things I’ve hit previously:
A1. Visibility conditions are not behaving in the context of loop. I have to make css workarounds to hide fields with no value because in visibility conditions when I select condition based on the meta-key I assume it compares the condition to the page, not to the card. Would be super valuable and usable if Visibility conditions could be more aware of the context.
A2. CPT doesnt appear in the populated list of CPTs when my CPT settings:
public: true + publicly queryable: false + show in REST API: true + has archive: false
I still can type manually, but can’t choose my CPT from the UI. The use case – having admin entry that is not supposed to have single page or archive, but needs to showup as FAQ items, or price items, or reviews etc.
A3. When choosing repeater values – please either make it one value per row, or show full wrapped text of the key, or show the key value on hover – because it is dangerous and impossible to know which field key you are choosing, when the first part is taken by meta box name.
A4. This website will also have polylalng multilingual setup, and I noticed that loops are always showing all the posts from all the languages. Is there a chance we could be able to have current language being appreciated in query loops, and language being available as Visibility Condition option?

Shukhrat

⏱

Replies

Responses

  1. Console logs:jquery-migrate.min.js?ver=3.4.1:2 JQMIGRATE: Migrate is installed, version 3.4.1deprecated.min.js?ver=fe587bac92b7d0ef760e:3 wp.plugins.withPluginContext is deprecated since version 6.8.0. Please use wp.plugins.usePluginContext instead.S @ deprecated.min.js?ver=fe587bac92b7d0ef760e:3deprecated.min.js?ver=fe587bac92b7d0ef760e:3 Block with API version 2 or lower is deprecated since version 6.9. See: https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/ Note: The block “am-recommended-blocks/facebook-feed” is registered with API version 1. This means that the post editor may work as a non-iframe editor. Since all editors are planned to work as iframes in the future, set the apiVersion field to 3 and test the block inside the iframe editor.S @ deprecated.min.js?ver=fe587bac92b7d0ef760e:3deprecated.min.js?ver=fe587bac92b7d0ef760e:3 Block with API version 2 or lower is deprecated since version 6.9. See: https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/ Note: The block “am-recommended-blocks/youtube-feed” is registered with API version 1. This means that the post editor may work as a non-iframe editor. Since all editors are planned to work as iframes in the future, set the apiVersion field to 3 and test the block inside the iframe editor.S @ deprecated.min.js?ver=fe587bac92b7d0ef760e:3deprecated.min.js?ver=fe587bac92b7d0ef760e:3 Block with API version 2 or lower is deprecated since version 6.9. See: https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/ Note: The block “am-recommended-blocks/twitter-feed” is registered with API version 1. This means that the post editor may work as a non-iframe editor. Since all editors are planned to work as iframes in the future, set the apiVersion field to 3 and test the block inside the iframe editor.S @ deprecated.min.js?ver=fe587bac92b7d0ef760e:3deprecated.min.js?ver=fe587bac92b7d0ef760e:3 Block with API version 2 or lower is deprecated since version 6.9. See: https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/ Note: The block “am-recommended-blocks/reviews-feed” is registered with API version 1. This means that the post editor may work as a non-iframe editor. Since all editors are planned to work as iframes in the future, set the apiVersion field to 3 and test the block inside the iframe editor.S @ deprecated.min.js?ver=fe587bac92b7d0ef760e:3deprecated.min.js?ver=fe587bac92b7d0ef760e:3 Block with API version 2 or lower is deprecated since version 6.9. See: https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/ Note: The block “am-recommended-blocks/tiktok-feeds” is registered with API version 1. This means that the post editor may work as a non-iframe editor. Since all editors are planned to work as iframes in the future, set the apiVersion field to 3 and test the block inside the iframe editor.S @ deprecated.min.js?ver=fe587bac92b7d0ef760e:3deprecated.min.js?ver=fe587bac92b7d0ef760e:3 Block with API version 2 or lower is deprecated since version 6.9. See: https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/ Note: The block “am-recommended-blocks/threads-feeds” is registered with API version 1. This means that the post editor may work as a non-iframe editor. Since all editors are planned to work as iframes in the future, set the apiVersion field to 3 and test the block inside the iframe editor.S @ deprecated.min.js?ver=fe587bac92b7d0ef760e:3api-fetch.min.js?ver=6f2a4faeee3c722b1e57:3 [api-fetch][preload] All preloads consumed.deprecated.min.js?ver=fe587bac92b7d0ef760e:3 wp.editPost.PluginMoreMenuItem is deprecated since version 6.6. Please use wp.editor.PluginMoreMenuItem instead.S @ deprecated.min.js?ver=fe587bac92b7d0ef760e:3jquery-migrate.min.js?ver=3.4.1:2 JQMIGRATE: Migrate is installed, version 3.4.1block-editor.min.js?ver=37e58da384b2558bd479:83 global-styles-css-custom-properties-inline-css was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe. ​M @ block-editor.min.js?ver=37e58da384b2558bd479:83block-editor.min.js?ver=37e58da384b2558bd479:83 blocksy-ext-woocommerce-extra-admin-styles-css was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe. ​M @ block-editor.min.js?ver=37e58da384b2558bd479:83block-editor.min.js?ver=37e58da384b2558bd479:83 woocommerce-classictheme-editor-fonts-css was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe. ​M @ block-editor.min.js?ver=37e58da384b2558bd479:83block-editor.min.js?ver=37e58da384b2558bd479:83 ct-options-styles-css was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe. ​M @ block-editor.min.js?ver=37e58da384b2558bd479:83react-dom.min.js?ver=18.3.1.1:121 TypeError: z.slice(…).map is not a functionat hb (index.js?ver=c9c5b524ed6ba7862ae2:1:772975)at mf (react-dom.min.js?ver=18.3.1.1:105:412)at zf (react-dom.min.js?ver=18.3.1.1:127:55)at Qk (react-dom.min.js?ver=18.3.1.1:251:489)at Ri (react-dom.min.js?ver=18.3.1.1:195:185)at Ok (react-dom.min.js?ver=18.3.1.1:195:116)at Nd (react-dom.min.js?ver=18.3.1.1:194:492)at Qf (react-dom.min.js?ver=18.3.1.1:187:439)at Ni (react-dom.min.js?ver=18.3.1.1:185:400)at S (react.min.js?ver=18.3.1.1:17:25)wf @ react-dom.min.js?ver=18.3.1.1:121react-dom.min.js?ver=18.3.1.1:121 TypeError: z.slice(…).map is not a functionat hb (index.js?ver=c9c5b524ed6ba7862ae2:1:772975)at mf (react-dom.min.js?ver=18.3.1.1:105:412)at zf (react-dom.min.js?ver=18.3.1.1:127:55)at Qk (react-dom.min.js?ver=18.3.1.1:251:489)at Ri (react-dom.min.js?ver=18.3.1.1:195:185)at Ok (react-dom.min.js?ver=18.3.1.1:195:116)at Nd (react-dom.min.js?ver=18.3.1.1:194:492)at Qf (react-dom.min.js?ver=18.3.1.1:187:439)at Ni (react-dom.min.js?ver=18.3.1.1:185:400)at S (react.min.js?ver=18.3.1.1:17:25)wf @ react-dom.min.js?ver=18.3.1.1:121react-dom.min.js?ver=18.3.1.1:121 TypeError: z.slice(…).map is not a functionat hb (index.js?ver=c9c5b524ed6ba7862ae2:1:772975)at mf (react-dom.min.js?ver=18.3.1.1:105:412)at zf (react-dom.min.js?ver=18.3.1.1:127:55)at Qk (react-dom.min.js?ver=18.3.1.1:251:489)at Ri (react-dom.min.js?ver=18.3.1.1:195:185)at Ok (react-dom.min.js?ver=18.3.1.1:195:116)at Nd (react-dom.min.js?ver=18.3.1.1:194:492)at Qf (react-dom.min.js?ver=18.3.1.1:187:439)at Ni (react-dom.min.js?ver=18.3.1.1:185:400)at S (react.min.js?ver=18.3.1.1:17:25)wf @ react-dom.min.js?ver=18.3.1.1:121react-dom.min.js?ver=18.3.1.1:121 TypeError: z.slice(…).map is not a functionat hb (index.js?ver=c9c5b524ed6ba7862ae2:1:772975)at mf (react-dom.min.js?ver=18.3.1.1:105:412)at zf (react-dom.min.js?ver=18.3.1.1:127:55)at Qk (react-dom.min.js?ver=18.3.1.1:251:489)at Ri (react-dom.min.js?ver=18.3.1.1:195:185)at Ok (react-dom.min.js?ver=18.3.1.1:195:116)at Nd (react-dom.min.js?ver=18.3.1.1:194:492)at Qf (react-dom.min.js?ver=18.3.1.1:187:439)at Ni (react-dom.min.js?ver=18.3.1.1:185:400)at S (react.min.js?ver=18.3.1.1:17:25)wf @ react-dom.min.js?ver=18.3.1.1:121react-dom.min.js?ver=18.3.1.1:121 TypeError: z.slice(…).map is not a functionat hb (index.js?ver=c9c5b524ed6ba7862ae2:1:772975)at mf (react-dom.min.js?ver=18.3.1.1:105:412)at zf (react-dom.min.js?ver=18.3.1.1:127:55)at Qk (react-dom.min.js?ver=18.3.1.1:251:489)at Ri (react-dom.min.js?ver=18.3.1.1:195:185)at Ok (react-dom.min.js?ver=18.3.1.1:195:116)at Nd (react-dom.min.js?ver=18.3.1.1:194:492)at Qf (react-dom.min.js?ver=18.3.1.1:187:439)at Ni (react-dom.min.js?ver=18.3.1.1:185:400)at S (react.min.js?ver=18.3.1.1:17:25)wf @ react-dom.min.js?ver=18.3.1.1:121

  2. support_angel Avatar
    support_angel
    Support

    Thanks for the detailed report.

    Crash: fixed in GreenLight 3.4.0. The nested repeater field arrives as text (a JSON string), and the editor tried to loop over it as a list, which caused “slice(…).map is not a function”. The editor now decodes JSON strings the same way the frontend does, and other text values no longer crash the block.

    A2 (CPT missing from the list): fixed in the same update. Post types with public: true and publicly_queryable: false now appear in the query and repeater post type lists.

    A1 (visibility conditions in the loop context), A3 (long repeater keys) and A4 (Polylang language in loops) are feature requests, we have noted them.

    1. I tried to format my previous response and attach some media files but it looks they are not getting attached to my message, and the formatting is gone too. Here is a link to google drive folder with the screenshot and screencast of the behavior I am observing after the update:https://drive.google.com/drive/folders/15d_jZgqnXCRkOvF9JQgo-6AVcKmDD62g?usp=sharingI hope it helps. Let me know if you need more information, more access or jump on the call and investigate use case more in depth.

  3. I can confirm that choosing the nested repeater field doesn’t crash the inner block anymore, but I can’t confirm that the workflow is fixed on my side. The dynamic fields are not available to choose on child items – blocks are seem to be locked. Also, when I select “Nested repeater field” option, and then select “Nested data” – the “Nested repeater field” goes back to “Select Dynamic Source”. And I can’t confirm the A2 working on my side unfortunately – my post types with public: true and publicly_queryable: false and has_archive: false do not appear on the list yet. (In my case the should be FAQs and Price Item post types available on the list).

    I hope screenshots help a little.Also, should I better add the A1, A3 and A4 into feature requests, or is it okay this way?

Post a Reply