Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When viewing source code of read-only pages, button css classes are unexpectedly added to the source code text #578

Open
erieeru opened this issue Dec 10, 2022 · 0 comments

Comments

@erieeru
Copy link

erieeru commented Dec 10, 2022

Description

In tpl/bootstrap3/EventHandlers.php, the formEditOutput() function did not check whether findPositionByAttribute() returned a non-false value. So when viewing read-only pages, it adds the css classes for the "save", "preview", and "cancel" buttons to the textarea containing source code, as it is not aware that these buttons are not present.

This causes the source code text to display incorrectly with broken word wrap as it is shown with the button css styles.

To fix this: simply add if ($form->findPositionByAttribute('name', 'do[save]') !== false) (and two others alike) before adding classes.

Steps to reproduce

  1. Install bootstrap 3 template
  2. (Unsure of potential influence by other plugins, but should be unlikely)
  3. View any read-only page

Expected behavior: Source code to be displayed normally (for example)

Actual behavior: Source code shows with css classes for buttons

Versions

  • [Bootstrap3 Template] 2022-07-27
  • [DokuWiki] 2022-07-31 "Igor"
  • [PHP] 7.4
  • [Browser] Chrome / Safari

Screenshots or Logs

https://wiki.crescb.com/lib/exe/fetch.php?media=screenshot.jpg

Sample page or snippet

Could not provide one as my own page is already fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants