silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
721 stars 821 forks source link

source_file_comments breaks CMS search #9211

Open LABCAT opened 5 years ago

LABCAT commented 5 years ago

Affected Version

silverstripe/recipe-cms 4.4.2 silverstripe/framework 4.4.2

Description

Turning on source file comments breaks the CMS search and only 1 item will be displayed per grid field page.

Steps to Reproduce

  1. Use CMS search to search by page type for a page type with more than 15 pages (this works!)
  2. Turn on source file comments.
  3. Repeat search in step 1, there will now only be one gridfield row per page (items per page is still set to 15)
Cheddam commented 5 years ago

Note that this seems to be caused by the template comments getting munched in the output:

Excerpt from results output with source_file_comments enabled ``` HomeModified

Home ```

Marked as low impact as source_file_comments is primarily a debugging tool.

lerni commented 5 years ago

If template comments wouldn't show for file/mime-types that do not allow comments such as json I guess the issue would be solved, but is this even possible/manageable? https://stackoverflow.com/questions/244777/can-comments-be-used-in-json