I use Paragraph View Mode with Layout Paragraphs.

Layout Paragraphs requires to change the paragraph widget to "layout paragraphs" in paragraphed content types.

After that, when I added Paragraph View Mode, everything went smoothly, I check the box "Enable Paragraph view mode field on this paragraph type".
There is a warning "Behavior plugins are only supported by the EXPERIMENTAL paragraphs widget", but everything worked as expected.

Then I built content.

Then, after I updated modules and upgraded Drupal core to 9.3 , I discovered that I had lost all Paragraph View Mode functionality. The aforementioned checkbox in Paragraph properties was still checked, but no field "Paragraph view mode" was shown anymore, neither in the Paragraph properties' field list, and neither on the paragraph edit window.
Also, all paragraphs were displayed in "default view mode" in the Website's rendered HTML source.

I then tried unchecked the box, saved, then checked it again and saved again, and the functionality was back.

Regrettably, all Paragraph view mode settings for existing paragraphs are lost.

I am not able to exactly pinpoint the problem, but maybe someone will have an idea as to why this happened.

Comments

manarak created an issue. See original summary.

sayco’s picture

Hi, thanks for reporting.

Regarding the checkbox for enabling/disabling the paragraph field it was already fixed here:
https://www.drupal.org/project/paragraph_view_mode/issues/3247770
The original issue was that the paragraph widget settings were lost once the paragraph type was saved.

The fix is included in the 2.0.3 version. So I hope you are using the latest one.

What might happened in your case (just guessing) was:
- you've may probably install the layout paragraph module before having the paragraph view mode module updated,
- there must happen the saving of the paragraph type form for some reason,
- because of the save of the paragraph type the widget settings were lost.

All of the above may not be true, still
I suppose that it was caused by the mentioned & linked issue, and any action that happened on your site
took place before having that latest version of the module.

Please let us know if that might be the case.

sayco’s picture

Status: Needs work » Postponed (maintainer needs more info)
drupaldope’s picture

hahaha
it seems Murphy's law has struck again.

after I noticed that I had lost functionality, I tried downgrading to 2.0.2 to see if the last release was to blame.

and then, while still using 2.0.2, I tried unchecking the box and re-checking it again :facepalm:

sayco’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

So it seems like the problem was solved?
I hope you'll have more luck next time then! :D

drupaldope’s picture

actually, the issue was not solved.

I tried again with version 2.0.3

de-activating and re-activating the checkbox brought the listbox back on individual paragraphs' edit mode, but the existing settings were lost.

so there is an issue with retrieving existing paragraph settings.

sayco’s picture

Status: Closed (works as designed) » Postponed (maintainer needs more info)

But you are saying about the old settings you had?
Once you 've updated the module any new settings are not deleted anymore when saving the paragraph type?

drupaldope’s picture

thank you for your reply.

the problem is that the old settings disappear when the module is updated to 2.0.3

maybe I had set them with the module in version 2.0.1 or 2.0.2, and when updated to 2.0.3, poof, gone.

about the new settings, I guess I will have to wait for another update, maybe 2.0.4, to see if settings that were set with 2.0.3 will be persistent or will disappear again with the update.

this is a blocking issue for me, because I am about to make a series of websites that will rely on view modes instead of making separate paragraph types for every responsive image view mode I want to use.

disappearing settings are not fun on a website with 100 paragraphs using this feature.

sayco’s picture

Seem like I don't follow... Could you explain to me what is happening with the new settings?
If you are on the 2.0.3 version and you'll set up the paragraph once again (save all the settings), then what is happening, once you'll try to:

I then tried unchecked the box, saved, then checked it again and saved again, and the functionality was back.

Is the same thing happening on 2.0.3? (settings werelost):

all Paragraph view mode settings for existing paragraphs are lost.

Or stayed untouched (all good)?

drupaldope’s picture

the issue is that individual paragraph view mode settings that were present with core version 9.2.10 and paragraph view mode version 2.0.x (< 2.0.3) get lost when upgrading to core 9.3.x and paragraph view mode v. 2.0.3

symptoms include:
- paragraph view mode list box not appearing on individual paragraph edit form, but the checkbox is still checked in the paragraph type settings
- unchecking & saving and then re-checking & re-saving the paragraph type settings brings back the paragraph view mode listbox on the individual paragraphs edit form, but previously set view modes on individual paragraphs are lost. when editing any individual paragraph, the chosen view mode is "default" instead of the view mode previously set in version 2.0.x (< 2.0.3)

so the question is, for people who have sites using paragraph view mode 2.0.x , is there a way to upgrade the module without losing the individual paragraph settings?

and the second question is, if view modes are set for individual paragraphs in version 2.0.3, will they be persistent and still be set after core and module get updated to 9.4.x and 2.0.4 ?

and the next question - what will happen when the module is updated to 3.0.x when it's ready? will individual paragraph view mode settings be preserved?

sayco’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I wasn't able to reproduce the issue unfortunately and don't know what was going on.
It could be reopened or a new issue created once the issue comes back for someone else.
We are now focusing on 3.x version only so I hope it won't happen ever again.