Problem/Motivation

Using the upload widget doesn't seem to work when used inside the Paragraphs module. This is almost same as on 1.x branch #2945317: H5P content lost when collapsing/opening in Paragraphs

Steps to reproduce

1. Add H5P field inside Paragraphs component. Set field to use Upload widget.
2. Create node with Paragraphs with H5P field, save the node.
3. H5P file is not uploaded due to parent element validation in src/Plugin/Field/FieldWidget/H5PUploadWidget.php

Proposed resolution

Match the validation better.

Issue fork h5p-3308118

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sokru created an issue. See original summary.

sokru’s picture

Status: Active » Needs review
StatusFileSize
new764 bytes

This should work both with and without Paragraphs/IEF etc.

jhuhta’s picture

StatusFileSize
new4.56 KB

#2 was not quite enough. The problem with the Paragraphs use seems to be that the H5P module expects the field name to be unique, and that's not the case if H5P is a paragraph type. This patch should fix it.

This one also contains an idea from #3308102: Indication of uploaded .h5p file, but it didn't quite work standalone without this one either.

illeace’s picture

Status: Needs review » Reviewed & tested by the community

This patch still applies as of the release of 2.0.0-alpha6, and seems to fix the problem indicated. I did a bit of testing using the H5P file upload widget within a paragraph and also in a standard node, using single and mulit-value fields. Everything I tried worked. Marking RTBC.

sim_1 made their first commit to this issue’s fork.

sim_1’s picture

sim_1’s picture

Created a MR and tried to copy over all the changes from the patch file. I'll double-check that they look the same before merging.

  • sim_1 committed 07309f2a on 2.0.x
    Issue #3308118 by sim_1, sokru, jhuhta, illeace: Paragraphs module...
sim_1’s picture

Status: Reviewed & tested by the community » Fixed

Great! Thanks, all! Merged and marking as fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.