Migrate 2.2.6 changes in Twig - #51
Closed
ThomasDaSilva wants to merge 21 commits into
Closed
Conversation
check url after format
fix import for url with query string
* fix inverted url * add position
Redirecting a URL Thelia already knows removed it from its product/category and left that object without any canonical URL: the front answered a 500 on every URL of the object. Such a URL is now redirected by a text rule, which leaves the rewritten URLs untouched, and repairs the objects broken by a previous import. Also report each conflicting line instead of silently importing it, store the URL of the line for gone (410) URLs instead of the marker of the GONE column, and stop redirecting to the home page when no target is given.
…left The router redirected to the canonical URL of the object without checking it exists, which raised "Call to a member function getUrl() on null". It now falls back on the target of the redirection, and answers a 404 rather than looping on itself. Text rules and gone URLs are also looked up with the decoded path, so that URLs containing accents match the values stored in the back-office.
The CSV serializer of Thelia silently drops the lines which have not exactly as many columns as the header, so a missing trailing separator or a comma inside an URL made the line vanish from the import without any message. The file is read again by the import: lines missing their trailing columns are imported, lines with too many columns are reported with their line number, and a report gives the totals so that every line of the file is accounted for. Line numbers now refer to the file itself, the byte order mark of spreadsheet softwares is ignored and the semicolon separator is supported.
The rule redirects the URL whatever the state of the object it belongs to, so the import now tells for which lines a rule has been created and on which object, to let the rule be deleted if that product or category is put back online.
The twig branch has neither the CSV import nor the gone (410) URLs: this merges the 9 commits of main that add them, together with the fixes of fix/import-url-conflicts. Kept from the twig side: the minimal Config/config.xml, forms, services and hooks being registered by configureServices(); only the import declarations are added back, as nothing else can declare an import.
The Twig back-office had no template for that page, so it failed on render. The controller now also hands the rows over, the Smarty template keeping its loop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR brings the import and the gone URLs, for Thelia 3 compatibility.
Migrate all the commit from 2.2.0 to 2.2.6
Features
URL,REDIRECT,GONE)default-twigback-office page