Ticket #2165 (new enhancement)

Opened 12 months ago

Last modified 3 months ago

Can't make any other db fields translatable

Reported by: mpeel Owned by: ischommer
Priority: critical Milestone: 2.3.1
Component: (Unknown) Version: 2.2.0
Severity: medium effort / impact Keywords:
Cc: Hours:

Description

You can't add Translatable to any sub-class of SiteTree?, or the site fails to load in the translated languages.

e.g.

<?php
class Page extends SiteTree {
  static $db = array(
    "TestField" => "Text"
  );

  static $extensions = array(
    "Translatable('TestField')",
  );
}

This, when switching to the translated language (e.g. in the CMS), or implementing a method that checks if a page exists in other languages, causes SQL to die with weird errors - e.g. 'Page_lang_Live.OriginalLangID' doesn't exist (when it blatently does in the database).

I sort of got to a solution, but need to get this site out and can't investigate further.

FWIW, I noticed that if you specify extensions on sub-classes, it seems to call augmentSQL() twice, which is going to break quite a bit of Translatable (e.g. there are some lines which indiscriminately replace '.ID' with '.OriginalLangID' without checking if that table even has the column in the first place.

Change History

Changed 11 months ago by sminnee

  • owner changed from aoneil to mpeel
  • milestone changed from 2.2.2 feature-lock to 2.2.3 feature-lock

This has been fixed in a branch, but there are still a few bugs to iron out. Moving to 2.2.3.

Changed 11 months ago by sminnee

  • type changed from defect to enhancement

Changed 3 months ago by sminnee

  • owner changed from mpeel to ischommer
  • milestone changed from 2.2.3* to 2.3.0

Translatable is currently broken in trunk. It needs to be better than that for 2.3, either by incorporating Wakeless' code, or by patching it ourselves.

Changed 3 months ago by sminnee

  • severity changed from high effort / impact to medium effort / impact

Changed 3 months ago by sminnee

  • milestone changed from 2.3.0 to 2.3.1*
Note: See TracTickets for help on using tickets.