Unable to create registration type in Drupal 9 due to deprecated QueryFactory code.

Attached patch allows creation of registration type. No functional tests performed.
Please review

Comments

nzpling created an issue. See original summary.

norwegian.blue’s picture

Title: Drupal 9 compatibility - Deprecated code » Drupal 9: compatibility - Deprecated code
suresh prabhu parkala’s picture

Status: Active » Needs review
StatusFileSize
new2.31 KB
new438 bytes

Please review!

andypost’s picture

Parent issue: » #3109592: Roadmap for 3.0.0 release
Related issues: +#3135740: Drupal 9: config_export definition missing in annotation
StatusFileSize
new9.53 KB
new12.29 KB

Proper patch based on #3135740-2: Drupal 9: config_export definition missing in annotation credits to @nzpling (no reason to mix annotations and EM=>ETM changes

It could use follow-up to clean-up doc-blocks more but as this files touched already I did fix

  1. +++ b/src/EventMeta.php
    @@ -380,7 +380,7 @@ class EventMeta implements EventMetaInterface {
    -      ->entityManager
    +      ->entityTypeManager
    

    wrong rename

  2. +++ b/src/Form/RegistrationTypeForm.php
    @@ -13,22 +13,26 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
    -  public function __construct(QueryFactory $query_factory) {
    ...
    +  public function __construct(EntityTypeManagerInterface $entity_type_manager) {
    

    better to remove old constructor - fixed with this patch

mandclu’s picture

Status: Needs review » Reviewed & tested by the community

I experience a fatal error about the use of the missing entity.manager in Drupal 9 after installing RNG, and the patch in #4 resolved it for me.

chrisla’s picture

Had same issue with errors after install on Drupal 9 site using dev branch:

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The service "access_check.rng.event_registrations_allowed" has a dependency on a non-existent service "entity.manager". in Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processValue() (line 86 of /var/www/html/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php).

Patch in #4 made that error go away.

Now get:

Drupal\Core\Config\Schema\SchemaIncompleteException: Entity type 'Drupal\rng\Entity\RegistrantType' is missing 'config_export' definition in its annotation in Drupal\Core\Config\Entity\ConfigEntityBase->toArray() (line 252 of core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php).

chrisla’s picture

Looks like there is a patch here for the config issue, in case anyone finds this thread and not other one -- https://www.drupal.org/project/rng/issues/3135740

chrisla’s picture

Needed these patches as well to get a D9 installation working to fix regarding error Recoverable fatal error: Object of class Drupal\Core\Link could not be converted to string in Drupal\Core\Database\Statement->execute() (line 59 of /var/www/CMS/drupal8/web/core/lib/Drupal/Core/Database/Statement.php)

https://www.drupal.org/project/rng/issues/3160117

https://www.drupal.org/project/rng/issues/3160120

anybody’s picture

Any plans for a new Drupal 9 compatible release @ new maintainers?

  • andypost authored 30c0bdf on 3.x
    Issue #3157334 by Suresh Prabhu Parkala, andypost, norwegian.blue: Fixed...
megachriz’s picture

Status: Reviewed & tested by the community » Fixed

Committed #4 with a few changes: replaced variable names $entity_manager with $entity_type_manager.

anybody’s picture

Whao, cool to see you here @MegaChriz!
Thanks for the fixes!

We finally abandoned this module in our projects as it's still a very important tool for Drupal, but the current implementation caused a lot of headaches and problems in the past... Looking forward to what will happen here as you're on it now!

The project seemed pretty dead :)

megachriz’s picture

Hi @Anybody
I'm using this project on a client site (with custom modules depending on it), so trying to move it to D9 looks like to taking a much lesser amount of time than trying to replace RNG completely with something else.
But the Feeds project does remain my main focus. I suppose I cannot fix all the (major) RNG issues in the long run.
This week my goal is to get all tests of RNG passing, after that I can hopefully see where things are still broken then on the client site.

anybody’s picture

@MegaChriz, thank you for your reply. Well yes, I guess then you're running into similar problems as we did... ;) Lot of frustration... :P
Also see this issue #3109592: Roadmap for 3.0.0 release.

I very much appreciate your time on this project even though we're not using it anymore. The Drupal community owes you a great debt of gratitude for all that.

megachriz’s picture

@Anybody
Ow, that sounds like this going to be tougher than I had imagined. :( I had hoped it was mainly deprecation warnings and converting tests from simpletest to phpunit - and then maybe a few remaining small bugs to fix.
Well, I'll see how it goes this week (fingers crossed).

anybody’s picture

@MegaChriz, whao you made some progress!!

I was just in a project where we used RNG before and found the following issues which were never merged, but required for us and are still on GitHub. Just if they're relevant in your case:

"drupal/rng": {
                "RNG: Open registration form by default if only one person type: (https://github.com/dpi/rng/issues/158)": "https://github.com/dpi/rng/files/1706894/rng-158-open_registrant_form_by_default_if_one_registrant_type.patch.txt",
                "Redirect back to the event instead of frontpage (https://github.com/dpi/rng/pull/161)": "https://patch-diff.githubusercontent.com/raw/dpi/rng/pull/161.patch",
                "Drupal 8.5 compatibility (https://github.com/dpi/rng/pull/165)": "https://github.com/dpi/rng/commit/38d3ac1c0a62511dff10a71be4ebde9d1e9680c3.patch"
            },
            "drupal/courier": {
                "Filter HTML content / markup correctly in courier emails (https://github.com/dpi/courier/pull/46)": "https://patch-diff.githubusercontent.com/raw/dpi/courier/pull/46.patch"
            },
"drupal/rng_date_scheduler": {
                "Handle route [...]/event/dates as _admin_route like rng (https://github.com/dpi/rng_date_scheduler/pull/3)": "https://github.com/dpi/rng_date_scheduler/pull/3/commits/bae489e2e3b970d2d506017ce9d443bb5c836e0e.patch",
                "RNG date scheduler: Add datetime range field support (https://github.com/dpi/rng_date_scheduler/issues/2): ": "https://github.com/dpi/rng_date_scheduler/files/1710243/rng_date_scheduler-add-daterange-support.patch.txt"
            }

Status: Fixed » Closed (fixed)

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