wazum / sluggi

The TYPO3 CMS slug helper
GNU General Public License v3.0
38 stars 22 forks source link

Editing page outside of sites with default page option Synchronize URL Segment creates error #83

Open jpmschuler opened 1 year ago

jpmschuler commented 1 year ago

Exception 1521716622 no site found in rootline of page is thrown if I edit the title of a page outside a site config, as long as Synchronize URL Segment is active.

It seems this option tries to update the slug (obviously) but tries to find the root page to get the prefix or something, but sometimes root pages won't exist.

Our page structure is like

\ Customer A
| \ Sitepackage A-A
|   |\ Subcustomer A-A-A
|   |    |\ Site 1
|   |    |
|   |    |\ Site 2
|   |\ Subcustomer A-A-B
....
| \ Sitepackage A-B

So the first 3 levels are used for structuring the 60+ sites and 4 templates in the system, so the actual sites/domains are on level >= 3 and I was renaming a Subcustomer.

wazum commented 1 year ago

@jpmschuler thanks for the report, what would you expect for these pages? No sluggi action at all? Help me to find the correct use case.

jpmschuler commented 1 year ago

From a pragmatic perspective: If no parent SITE, then skip processing. The reason here: If I disable EXT:sluggi, that field exists and can be changed for that case.

I don't know an answer from a conceptional perspective: as the slug probably won't be used to create an URI for that page it shouldn't be available at all. However it could be that a non-site page is mounted somewhere, so it could be used nevertheless, however nobody would expect an autoslug to work there.

So in the end: This is an edge case. Doing nothing and gracefully catching the exception, perhaps issuing a FlashMessage to be transparent would be the way to go.