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

Fix for SearchInDocument plugin if using routeEnhancers (Slug) #561

Merged

Conversation

albig
Copy link
Collaborator

@albig albig commented Dec 8, 2020

With TYPO3 9.5 the advanced page routing is builtin. There is no need to
install any third party extension like realurl anymore.

Using the routeEnhancer with the pageview makes it possible to write
shorter URLs like

http://example.com/workview/123/1

which is short for

http://example.com/workview?tx_dlf[id]=123&tx_dlf[page]=1

The current implementation of the SearchInDocument plugin has to build
the target URLs from the searchresults in JavaScript. It does it by
appending the GET-parameter to the base_url. The resulting URL could
look like this:

http://example.com/workview/123/1?tx_dlf[id]=123&tx_dlf[page]=5&tx_dlf[highlight_word=searchword

In fact the GET parameter are given twice to TYPO3. This was tolerated
in the past by realurl on TYPO3 8.7 but brings an exception with TYPO3
9.5.

The way the plugin calculates the base URL in JavaScript is even to
complicate. It would be sufficiant to take it from the form action URL.
This way, the double GET parameters are avoided.

With TYPO3 9.5 the advanced page routing is builtin. There is no need to
install any third party extension like realurl anymore.

Using the routeEnhancer with the pageview makes it possible to write
shorter URLs like

  http://example.com/workview/123/1

which is short for

  http://example.com/workview?tx_dlf[id]=123&tx_dlf[page]=1

The current implementation of the SearchInDocument plugin has to build
the target URLs from the searchresults in JavaScript. It does it by
appending the GET-parameter to the base_url. The resulting URL could
look like this:

  http://example.com/workview/123/1?tx_dlf[id]=123&tx_dlf[page]=5&tx_dlf[highlight_word=searchword

In fact the GET parameter are given twice to TYPO3. This was tolerated
in the past by realurl on TYPO3 8.7 but brings an exception with TYPO3
9.5.

The way the plugin calculates the base URL in JavaScript is even to
complicate. It would be sufficiant to take it from the form action URL.
This way, the double GET parameters are avoided.
@albig albig added the 🛠 maintenance A task to keep the code up-to-date and manageable. label Dec 8, 2020
@albig albig self-assigned this Dec 8, 2020
@sebastian-meyer sebastian-meyer merged commit ec650c9 into kitodo:master Dec 8, 2020
@albig albig deleted the using-slug-with-searchInDocument branch July 19, 2021 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠 maintenance A task to keep the code up-to-date and manageable.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants