fix: #3609165 Resolve the NodeAccessRebuild service by its class-name id (fresh-install ServiceNotFoundException)
A fresh Varbase 10.1.x install on Drupal 11.4 fatals during install.
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "\Drupal\node\NodeAccessRebuild".Problem / Motivation
varbase.profile called \Drupal::service('\Drupal\node\NodeAccessRebuild')->rebuild();. The service-id string has a leading backslash, so it does not match the registered service id Drupal\node\NodeAccessRebuild (defined in core/modules/node/node.services.yml) → the container throws ServiceNotFoundException and install aborts.
Proposed resolution
Call the service the same way Drupal 11.4 core does: use Drupal\node\NodeAccessRebuild; at the top of the file, then \Drupal::service(NodeAccessRebuild::class)->rebuild();. This is the documented non-deprecated replacement for node_access_rebuild() (deprecated in 11.4, see https://www.drupal.org/node/3534610), and the ::class id has no leading backslash so it resolves correctly.
Verified locally on a fresh Varbase 10.1.x (Drupal 11.4) install: install completes, front page 200, no ServiceNotFoundException; php -l clean.
By: rajab natshah AI-Generated: Yes (Claude Code)
Checkpoints
- File an issue about this project
- Addition/Change/Update/Fix to this project
- Testing to ensure no regression
- Automated unit/functional testing coverage
- Developer Documentation support on feature change/addition
- User Guide Documentation support on feature change/addition
- UX/UI designer responsibilities
- Accessibility and Readability
- Reviewed by a human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Update Release Notes
- Release