Installing version 1 or 2 of the module on a Drupal 9 site fails with the following error:

This is the error: The website encountered an unexpected error. Please try again later.
Error: Class "Drupal\Core\Render\Element\FormElementBase" not found in include() (line 25 of modules/contrib/commerce_product_review/src/Element/OverallProductRating.php).

FormElementBase in Drupal 9 is not the same as 10+.

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

sleewok created an issue. See original summary.

agoradesign’s picture

ok, then we have to remove D9 support from 2.x branch

sleewok’s picture

I may have it working. The only issue I have now is that the reviews do not show on the product page (using layout builder). How is it supposed to work on layoutbuilder product pages? If I can verify it is working properly we could create a branch with all my code changes for Drupal 9.

I would also suggest having a separate download for version 1 and drupal 9. At some point it worked, but it was changed and that broke drupal 9 support.

agoradesign’s picture

no idea. I've never ever used layout builder. So I don't know, if it ever worked

rhovland’s picture

Version: 2.0.0-rc2 » 2.0.x-dev

It works with Layout Builder. See the readme.md file, known issues section for details on how to make it work. It's also on the project page under Known Issues.

It looks like FormElement is depreciated in favor of FormElementBase and FormElement will be removed in Drupal 12. FormElementBase doesn't exist in Drupal 9.

Since Drupal 9 is no longer supported we will need to drop support for it in 2.x because of this depreciation.

agoradesign’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • rhovland committed a6f03467 on 8.x-1.x
    Issue #3555805: Remove support for Drupal 9
    
rhovland’s picture

Also removed Drupal 9 support from 1.x because it's been unsupported for 2+ years. If you're still on 9 then you're already insecure. Supporting it doesn't make sense when Drupal 12 is a couple months away.

Status: Fixed » Closed (fixed)

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