Skip to content

Migrate 2.2.6 changes in Twig - #51

Closed
ThomasDaSilva wants to merge 21 commits into
thelia-modules:twigfrom
ThomasDaSilva:fix/import-url-conflicts-twig
Closed

Migrate 2.2.6 changes in Twig#51
ThomasDaSilva wants to merge 21 commits into
thelia-modules:twigfrom
ThomasDaSilva:fix/import-url-conflicts-twig

Conversation

@ThomasDaSilva

Copy link
Copy Markdown
Contributor

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

  • Import RewriteUrl (CSV: URL, REDIRECT, GONE)
  • GoneUrl (410), with its default-twig back-office page

ThomasDaSilva and others added 21 commits February 20, 2026 15:23
* 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.
@anoziere
anoziere deleted the branch thelia-modules:twig August 19, 2026 07:28
@anoziere anoziere closed this Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants