question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On-page, in-context editing of areas nested in array elements does not save

See original GitHub issue

This turns out to be a longstanding issue:

If I have an area inside a field of type array and I want to edit that area contextually on the page, I can’t.

I hoped to fix this simply, but there’s a problem. The contextualConvert mechanism depends on scoping the search for relevant elements via a parent element, and array items don’t necessarily have one on the front end of websites, or it’s site-dependent.

We could address it by saying something ilke this:

“If you want contextual editing of the content of the array elements, you have to introduce a [data-apos-array-item="item._id"] attribute on a wrapper element. You don’t have to do this, but you can’t have contextual editing unless you do.”

This would require minimum change to the code.

Or, we could address it by locating contextually editable fields by their full dot paths, which would mean it wouldn’t matter if the intervening structures had a representation in the DOM or not. This would involve tricky fallbacks for bc and could complicate things if someone actually introduces array editing in context (adding/removing/etc).

The first solution makes the most sense to me. We could provide a helper to make it less awkward. People are going to forget to do it and complain. Hmm.

cc @stuartromanek

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:36 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
boutellcommented, Nov 30, 2018

Definitely not intentional, good catch, thank you. I am bringing this fix back.

On Fri, Nov 30, 2018 at 2:19 PM antoine beauᵛᵃᴵˢ⁻lacᵃˢˢᵉ < notifications@github.com> wrote:

This bug is back as of 2.71.0 ; the last working release is 2.70.1.

It seems the work done in #1656 https://github.com/apostrophecms/apostrophe/pull/1656 was removed in this commit https://github.com/apostrophecms/apostrophe/commit/c77793abaccb54c7b5c0ead5f46d4b96555d450e#diff-b0d621dfdf98ca7597f35de72d06395d :

Nothing in the changelogs or commit messages seem to mention this; @boutell https://github.com/boutell was this intentional?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe/issues/993#issuecomment-443310275, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB9fSPiVa9Ft4k-dzlVIyb5DASVB_phks5u0YTMgaJpZM4PJK9w .

Thomas Boutell, Chief Software Architect P’unk Avenue | (215) 755-1330 | punkave.com

1reaction
bionaracommented, Jan 8, 2018

Thanks @boutell ! Out of interest, would it be worth submitting simple widgets such as multi col one back to the apos community? IF so, how do you do that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug - Error displaying nested arrays in the inspector
When you let go, it disappears again. It doesn't let you edit the element at all. The only fix Ive found is downgrading...
Read more >
javascript - firestore error:"Nested arrays are not supported ...
I think "draw" function is ok. Your problem is on "startPath". See, "currentPath" is an array. You are pushing that array to "drawing"....
Read more >
Array.prototype.flat() - JavaScript - MDN Web Docs
The flat() method creates a new array with all sub-array elements concatenated into it recursively up to the specified depth.
Read more >
Nested data limitations - Amazon Redshift - AWS Documentation
The following limitations apply to nested data: An array can only contain scalars or struct types. Array types can't contain array or map ......
Read more >
Analyze complex data types in Azure Synapse Analytics
How to analyze arrays and nested structures with Apache Spark and SQL.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found