Page MenuHomePhabricator

Enable template transclusion and upgrade to latest syntax version not possible
Closed, ResolvedPublic4 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

  • The pages are still marked as using old syntax and having template transclusion not enabled at Special:PageTranslation

What should have happened instead?:

  • The pages should use the new syntax and have template transclusion enabled

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Nikerabbit subscribed.

I guess this is related to the long titles and hitting field lengths at some database fields.

I tested this locally with the page title: page-2023:Program/Submissions/التحقيق+التاريخي+لكي+يتم+معرف+الهدف+من+المعلومات+المنشوره+لكي+لا+تستخدم+هذه+المنصه+لنشر+المعلومات+المظلله+اي+-+JPLNWY and it does indeed fail:

Error 1406: Data too long for column 'tmd_group' at row 1
Function: TranslateMetadata::set
Query: REPLACE INTO `translate_metadata` (tmd_group,tmd_key,tmd_value) VALUES ('page-2023:Program/Submissions/التحقيق+التاريخي+لكي+يتم+معرف+الهدف+من+المعلومات+المنشوره+لكي+لا+تستخدم+هذه+المنصه+لنشر+المعلومات+المظلله+اي+-+JPLNWY','maxid',4)

Same as noted in T319375: Enforce maximum length of a translatable page title

The tmd_group column in translate_metadata is VARBINARY(200)

The size of this string is 238 byes:

<?php
$bin = 'page-2023:Program/Submissions/التحقيق+التاريخي+لكي+يتم+معرف+الهدف+من+المعلومات+المنشوره+لكي+لا+تستخدم+هذه+المنصه+لنشر+المعلومات+المظلله+اي+-+JPLNWY';
mb_strlen($bin, '8bit'); // Outputs: 238

I think we should either:

  • Convert tmd_group to VARCHAR(255) and then we can enforce it using mb_strlen.
  • Increase size of tmd_group from VARBINARY(200) to a much larger size and then check the size of the string and see if it exceeds the increased size.

See also MessageGroupStats::getDatabaseIdForGroupId. We could do something similar for this table.

Nikerabbit set the point value for this task to 4.Aug 1 2023, 11:34 AM

Change 952854 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] TranslateMetadata: Shorten long group id

https://gerrit.wikimedia.org/r/952854

Change 952854 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] TranslateMetadata: Shorten long group id

https://gerrit.wikimedia.org/r/952854

We are no longer allowing pages that have a very long title to be marked for translation. When considering the length of the page, we take into account the title of the page and the name of the translation units in the page.

In this specific case, you would have to reduce the size of the page title in order to mark the page as translatable.

See my comment on: https://phabricator.wikimedia.org/T319375#9209566 for more details.

Did a quick check on Meta-Wiki and the new code works as expected.