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

Edit existing link in HTMLEditor text, does not work if there are too many pages #11133

Open
2 tasks done
baukezwaan opened this issue Feb 9, 2024 · 0 comments
Open
2 tasks done

Comments

@baukezwaan
Copy link

Module version(s) affected

5.1.* and 4.13.*

Description

For sites with many childpages under a certain page (for instance newsitems in the Blog-module), it is not possible to see the current link in the tinymce-popup for editing internal links.

This has to do with the node_threshold_leaf preventing the childeren to be loaded in the output of the json of admin/Modals/editorInternalLink/field/PageID/tree.

For the editor this looks like this:
image

How to reproduce

  1. Install default Silverstripe installation
  2. In the CMS, create 5 pages under About Us-page.
  3. Change title of one of these pages to ABCDEF
  4. Edit the homepage Content, and create a hyperlink to page ABCDEF
  5. Save the page
  6. Observe editing the link, via the TinyMCE interface, shows the currently selected internal page
  7. Add a lower threshold in _config.php, by adding this line: SiteTree::config()->set('node_threshold_leaf', 3);
  8. Observe editing the link, via the TinyMCE interface, does NOT show the currently selected internal page

In the network panel this is visible, by openig the XHR-request in a new tab:

  1. Open https://localhost/admin/Modals/editorInternalLink/field/PageID/tree?forceValue=9&format=json
  2. Change the node_threshold_leaf value
  3. Refresh the json-page and see the children missing

This is even better visible, when changing the URL to &format=x

When the limit is not reached, this looks something like:

Home
About Us
Home
About Us
  - New Page
  - New Page
  - ABCDEF
  - New Page
Contact Us

But when the threshold is reached:

Home
About Us
  - Too many children (0)
Contact Us

Possible Solution

No response

Additional Context

No response

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
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