Problem/Motivation

In case when media types are missing Paragraphs Gridstack Demo module will cause an error during installation.

Take a look on paragraphs_gridstack_demo_install(), line 25.

Steps to reproduce

1) Remove default media types.
2) Enabled PG Demo module.

Proposed resolution

Check if the field exists using hasField() method. Log errors and create sample content without media.

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

Panchuk created an issue. See original summary.

bobi-mel’s picture

Assigned: Unassigned » bobi-mel
shreya_th’s picture

Assigned: bobi-mel » shreya_th

shreya_th’s picture

Assigned: shreya_th » Unassigned
Status: Active » Needs review

Hi @Panchuk,
I have solved this issue i.e. InvalidArgumentException: Field field_media_image is unknown in paragraphs_gridstack_demo.install() file and also created MR for this . Kindly review the changes.

panchuk’s picture

Status: Needs review » Needs work
shreya_th’s picture

Status: Needs work » Needs review
panchuk’s picture

Added a few improvements for paragraphs_gridstack_demo.install file. Refactored code and fixed coding standards issues.

  • Panchuk committed 541eeedf on 1.0.x authored by Shreya_th
    Issue #3392010: InvalidArgumentException: Field field_media_image is...
panchuk’s picture

Status: Needs review » Fixed

Thanks for your contribution, merged fixes into dev branch after tests on local env.

Status: Fixed » Closed (fixed)

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