backdrop-contrib / paragraphs

Paragraphs module to control your content flow
https://backdropcms.org/project/paragraphs
GNU General Public License v2.0
5 stars 11 forks source link

Issue #136 : Page preview problem fixes #146

Closed sudipto68 closed 1 month ago

sudipto68 commented 1 year ago

Fixes: #136

Page preview problem fixed.

stpaultim commented 1 year ago

@sudipto68 - We don't usuallly simply comment out lines. If we want to remove these, we'll need to actually remove them before this get's merged.

However, this might be good enough to get some eyes on the PR to make sure the change makes senses and/or to get someone else to test it.

@laryn - Does this look like a reasonable approach?

@sudipto68 - See the coding standards notes below. We will also need to fix those.

sudipto68 commented 1 year ago

@stpaultim Thanks for your information. I have removed the commented code and the coding standards problem was on that commented code, so It will also be removed.

laryn commented 1 year ago

@stpaultim @sudipto68 I think this code that is being removed was intended to help with the front end admin functionality -- rendering an insertion point if there are no paragraphs added in a paragraphs field. That said I'm not sure if we've tested that this is doing what it is supposed to on the front end (and I didn't see an issue about that in the queue, at least at a glance). If it's possible to have that functionality and to skip this bit of code if we're in preview mode, I think we'd have the best of both?

With this change, have you tested both nested paragraphs as well as front end modal administration?

herbdool commented 6 months ago

I've tested commenting out that section. Still has problems though. I've got a node with a wrapper paragraph type that contains three "card" paragraph types. When I preview the node it only shows the first nested card paragraph. And then going back to edit and it still only shows the first card. Refreshing brings back the rest.

nattywebdev commented 2 months ago

I have just come across this issue, for a customer that wants to preview pages with paragraphs. Has there been any update since the comments above?

herbdool commented 2 months ago

@laryn that section doesn't seem to be doing much. It's getting $entity_ids but then does nothing with them. And if it needs to return an empty array (with return $element), then maybe it should be moved inside of if (!empty($instance['settings']['modal_admin'])) {. Though even there is it working properly? I assume that someone could still edit the node even if the modal_admin setting is enabled. So it's got to know if it is actually in the modal or if it's in the regular editing form. Currently it is not doing that.

herbdool commented 2 months ago

Regarding the issue I have with some paragraphs not displaying is because of paragraphs embedded in paragraphs, I now suspect that it's not because of the modal_admin work. Might be something with the way Backdrop does node preview vs Drupal 7.

laryn commented 1 month ago

Thanks @sudipto68 -- and sorry I couldn't give more explicit time and attention here. I'm closing this one in favor of https://github.com/backdrop-contrib/paragraphs/pull/190 which was just merged.