- Issue created by @raffaelj
- Merge request !6917don't add wrapper padding to off-canvas if wrapper doesn't exist β (Open) created by raffaelj
After sending a merge request, all tests are passed, but there is one warning I don't understand:
If the last pipeline ran in the fork project, it may be inaccurate. Before merge, we advise running a pipeline in this project. Learn more
I skimmed the linked help page, but it just looks like generic information about how to setup CI pipelines.
Can I ignore it? If not, I need some guidance on how to resolve it.
- Status changed to Needs review
8 months ago 3:07pm 27 April 2024 Maybe I get some attention after discovering the "Needs review" status update feature :-)
- Status changed to Needs work
8 months ago 5:19pm 27 April 2024 - πΊπΈUnited States smustgrave
This may be border if it needs test coverage but the scenario makes me feel it may
Changing to 11.x as the current development branch.
> Changing to 11.x as the current development branch.
What's the recommended way to work with a changed dev branch? Should I merge the 11.x branch into my current issue fork or should I create a new issue fork?
> This may be border if it needs test coverage but the scenario makes me feel it may
OK. I have to learn, how to write JS tests for Drupal first. So this may take a while...
## Notes to myself
### Possible JS test solutions:
* https://www.drupal.org/docs/develop/automated-testing/types-of-tests#s-f... β
* https://www.drupal.org/docs/develop/automated-testing/browser-testing-us... β
* https://www.drupal.org/docs/develop/automated-testing/javascript-testing... β### Tutorial:
* https://www.drupal.org/docs/automated-testing/phpunit-in-drupal/phpunit-... β
### Test cases
* required modules: "announcements"
* run test as authenticated user
* run test on page, where the current theme is not the admin theme, e. g. `<front>`
* either create click event on "Announcements" button before JS tests or run JS directly
* test default setup with default theme (stable9 or stark should work) --> assert `document.querySelector('[data-off-canvas-main-canvas]') !== null`
* dynamically inject theme, that disables `off_canvas_page_wrapper` via `MY_THEME_element_info_alter`
* test default setup with injected theme --> assert JS error thrown
* test changed behaviour with my fix --> assert `document.querySelector('[data-off-canvas-main-canvas]') === null` && assert no JS error thrown- Status changed to Closed: won't fix
7 months ago 7:05pm 6 June 2024 - πΊπΈUnited States bnjmnm Ann Arbor, MI
This isn't really a a bug that requires fixing as is only happening when there is customization taking place, and it is something that can be mitigated with a little bit of additional customization.
Create a library that depends on
drupal.dialog.off_canvas
then include a js file that overridesDrupal.offCanvas.bodyPadding
andDrupal.offCanvas.resetPadding
something like this would work:
const oldBodyPadding = Drupal.offCanvas.bodyPadding; Drupal.offCanvas.bodyPadding = (event) => { if (!Drupal.offCanvas.$mainCanvasWrapper.length) { return }; oldBodyPadding(event) }
If this were impossible or noticeably difficult to address then categorizing as a bug would be appropriate, but in this case it is an issue that only occurs with a specific customization and can be fixed with not that much additional customization.
@bnjmnm Thanks for the workaround.
This isn't really a a bug
I would classify it as a bug, because Drupal is highly configurable and the script should check, if the node exists. But because I only noticed it in a fresh test installation, where the "announcements" module wasn't disabled already, I can live without the fix.
Partially overwriting a core jQuery library, that probably gets replaced with a vanilla JS implementation, feels fragile. Also my goal was to reduce bloat and not to add more (JS) libraries.
Now my "fix" is the advice to uninstall the announcements module when using my drinimal base theme. It's good enough for now...