Problem/Motivation

Trying to add a Paragraph Type and I get this PHP error:

TypeError: Drupal\paragraphs_ee\Entity\ParagraphsCategory::getDescriptionFormat(): Return value must be of type string, null returned in Drupal\paragraphs_ee\Entity\ParagraphsCategory->getDescriptionFormat() (line 82 of modules/contrib/paragraphs_ee/src/Entity/ParagraphsCategory.php).

Steps to reproduce

Click on "Add paragraphs catagory" in /admin/structure/paragraphs_category

Drupal version: 10.1.5
PHP: 8.1.23

CommentFileSizeAuthor
#12 cli info.mp42.38 MBkenrbnsn
#12 drupal errors.mp411.21 MBkenrbnsn

Comments

kenrbnsn created an issue. See original summary.

  • 9f6aa0ad committed on 10.0.x
    Issue #3392392 by kenrbnsn: Return value must be of type string, null...
stborchert’s picture

Version: 10.0.1 » 10.0.x-dev
Status: Active » Fixed

Uh, sorry about that. And thanks for finding this.

Fixed in https://www.drupal.org/project/paragraphs_ee/releases/10.0.2

kenrbnsn’s picture

Thanks. The page now comes up but I get these warnings:

Warning: Trying to access array offset on value of type null in Drupal\paragraphs_ee\Entity\ParagraphsCategory->getDescription() (line 75 of modules/contrib/paragraphs_ee/src/Entity/ParagraphsCategory.php).
Warning: Trying to access array offset on value of type null in Drupal\paragraphs_ee\Entity\ParagraphsCategory->getDescriptionFormat() (line 82 of modules/contrib/paragraphs_ee/src/Entity/ParagraphsCategory.php).
Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\filter\Element\ProcessedText::preRenderText() (line 101 of core/modules/filter/src/Element/ProcessedText.php).
stborchert’s picture

Status: Fixed » Active

@kenrbnsn: Where/ when do you get these warnings? I tried adding, editing, removing categories and paragraph bundles and created content but didn't see such warnings.

stborchert’s picture

Nevermind, I get the message now :/

abhishek_gupta1’s picture

Assigned: Unassigned » abhishek_gupta1
stborchert’s picture

@abhishek_virasat I'm already working on it. Thanks for offering your help.

stborchert’s picture

It seems that the update hook that modifies the existing paragraph categories did not run properly.

  • stBorchert authored 8769bc5e on 10.0.x
    Issue #3392392 by stBorchert, kenrbnsn: Return value must be of type...
stborchert’s picture

Please test the latest development branch. This should do ... hopefully.

kenrbnsn’s picture

StatusFileSize
new11.21 MB
new2.38 MB

Still getting the errors/warnings. I created a new empty site on ddev and did some screen captures.

  • stBorchert authored 6a80db2f on 10.0.x
    Issue #3392392 by kenrbnsn, stBorchert: Return value must be of type...
stborchert’s picture

Status: Active » Needs review

Ah. 🤦‍♂️ You don't see errors and warnings if you configure Drupal to not display them.

Thanks for the videos, that helped a lot. I've committed some changes that should finally fix this.

kenrbnsn’s picture

All fixed (for now...)

Thanks

jhuhta’s picture

Status: Needs review » Reviewed & tested by the community

This fixes the issue for us too.

stborchert’s picture

Status: Reviewed & tested by the community » Fixed
onfire84’s picture

Great to see this fixed!

Would it be possible to have a new release here? I feel a bit uncomfortable to use a dev version in production.

plk’s picture

The fix in the dev Branch "10.0.x" fixed this issue for me.
But the null checks and the fix is not founded in the 10.0.2 release.

Would you please release a new version?

Status: Fixed » Closed (fixed)

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