Error: Class "Drupal\profile\ProfileType" not found

Created on 3 April 2024, 3 months ago

After upgrading from profile 1.8 to 1.9 I get this error message:

Error: Class "Drupal\profile\ProfileType" not found in Drupal\profile\ProfileListBuilder->getDefaultOperations() (line 120 of modules/contrib/profile/src/ProfileListBuilder.php).
Drupal\Core\Entity\EntityListBuilder->getOperations() (Line: 212)
Drupal\Core\Entity\EntityListBuilder->buildOperations() (Line: 194)
Drupal\Core\Entity\EntityListBuilder->buildRow() (Line: 112)
Drupal\profile\ProfileListBuilder->buildRow() (Line: 242)
Drupal\Core\Entity\EntityListBuilder->render() (Line: 23)
Drupal\Core\Entity\Controller\EntityListController->listing()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Same problem with profile 1.10.

I do not allow multiple profiles per user, "Allow multiple profiles per user" is off.

And patch #16 of https://www.drupal.org/project/profile/issues/2599014 📌 Create the revision UI for profiles Needs review does not apply anymore.

I need a solution to get profile 1.9 and 1.10 running.

🐛 Bug report
Status

Closed: cannot reproduce

Version

1.0

Component

Code

Created by

🇦🇹Austria drupalfan2

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @drupalfan2
  • Assigned to sarwan
  • Issue was unassigned.
  • 🇮🇱Israel jsacksick

    @drupalfan2: Do you have any patches applied? the unpatched code doesn't have this line...

  • 🇦🇹Austria drupalfan2

    Yes, in profile 1.8 I have applied 2 patches via composer.json:

                "drupal/profile": {
                    "Provide Views argument for current user's profile ID": "https://www.drupal.org/files/issues/2021-03-23/profile-default-argument-2835930-3.patch",
                    "Create the revision UI for profiles": "https://www.drupal.org/files/issues/2020-05-21/profile-revisions-ui-2599014-16.patch"
                },
  • Status changed to Closed: cannot reproduce 3 months ago
  • 🇮🇱Israel jsacksick

    The first patch got committed and is present in the last release, the other patch seems to have the line your code is complaining about... But looks like it's importing the right namespace into the code...
    In any case, this bug isn't reproducible on a clean install, so closing this.

  • 🇦🇹Austria drupalfan2

    So the first patch "Provide Views argument for current user's profile ID" can be removed?

    Can you help to rewrite the second patch "Create the revision UI for profiles"?
    Or will patch #25 work?
    https://www.drupal.org/project/profile/issues/2599014 📌 Create the revision UI for profiles Needs review

    Thank you very much.

  • 🇮🇱Israel jsacksick

    So the first patch "Provide Views argument for current user's profile ID" can be removed?

    yes.

    Or will patch #25 work?

    It should... Try?

  • 🇦🇹Austria drupalfan2

    Thank you very much, seems to work.

    But I found another (older) problem of the patch #25: when profiles are updated a new revision is only generatet when the logged in user is the admin. For other users no new revisions are created when they log in and update/change their profiles.

Production build 0.69.0 2024