Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the custom Drupal 404 page so its assets (CSS/JS) are properly attached via the oit/oit_404 library and the controller returns a render array (instead of pre-rendered markup), which helps preserve attachments and render metadata.
Changes:
- Return the 404 page as a render array from
OitController::oit404()instead of flattening it into#markup. - Add
core/jqueryas an explicit dependency of theoit_404library (used byjs/404.js). - Scope most 404 CSS rules under
#containAll404to reduce accidental styling bleed.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Controller/OitController.php | Returns the 404 inline template as a render array to preserve attachments/metadata. |
| oit.libraries.yml | Adds explicit core/jquery dependency to the oit_404 library. |
| css/404.css | Adds file header docs and scopes selectors under #containAll404 for 404-only styling. |
Suppressed comments (1)
css/404.css:168
- The file header notes scoping to avoid style leakage, but the global
.breadcrumbrule will still hide breadcrumbs anywhere this library is attached. If the intent is for this to be 404-only, scope the selector to the 404 path/body class so the rule can’t affect other pages.
/* PAGE HIDES */
.breadcrumb {
display: none;
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+258
to
+261
| // Return the render array directly rather than flattening it into | ||
| // '#markup': that keeps the attached library and the cacheability | ||
| // metadata on the element that owns them. | ||
| return $custom; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pulling in 404 css