Currently the product description field is hardcoded to the name "body". We should make this configurable since it can be deleted. At least we need to check if it exists, because currenlty a fatal error is being thrown if was deleted:

InvalidArgumentException: Field body is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 509 of /var/www/drupal/public_html/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php).

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

Lukas von Blarer created an issue. See original summary.

luksak’s picture

Status: Active » Needs work
StatusFileSize
new2.72 KB

This patch hardcodes the name to my current case. At least we know all occurences now :)

luksak’s picture

StatusFileSize
new3.24 KB

Forgot one.

greg boggs’s picture

Hrm. I'm gonna have to skip this patch, but if you wanna make it dynamic, I'd be happy to add this one. See line 149 of the admin form where I added dynamic image field.

rwanth’s picture

Status: Needs work » Needs review
StatusFileSize
new7.39 KB

The attached patch provides a dynamic description field, per Greg's suggestion.

rwanth’s picture

Oops, line was missing from previous patch.

samuel.mortenson’s picture

Status: Needs review » Needs work

This looks good, but the only thing I'd request is that "body" is used as a fallback if the description field isn't set. That way we can prevent regressions for existing users.

samuel.mortenson’s picture

Category: Task » Feature request
Status: Needs work » Needs review
StatusFileSize
new7.55 KB
new2.5 KB

Could someone review this patch to see if it works for them? I noticed a few things that could be changed.

carsteng’s picture

fyi... I have added this patch in #8 also to https://www.drupal.org/node/3065917

rwanth’s picture

Version: 8.x-1.x-dev » 2.x-dev

This issue is still valid for 2.x, opening a merge request and re-rolling patch.

ducktape’s picture

Status: Needs review » Reviewed & tested by the community

Tested and verified, this looks good.

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

  • xenophyle committed 29702757 on 2.x authored by rwanth
    Issue #2916820 by rwanth, xenophyle, luksak, samuel.mortenson, ducktape...
xenophyle’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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