10979 Posts in 2722 Topics by 1815 members
|Go to End|
19 October 2012 at 12:32pm Last edited: 19 October 2012 12:36pm
I've just finished creating MemberProfile pages on my dual-language website. I have one page for registering and another page so that users can edit their profiles.
I've noticed that pages of the "MemberProfile Page" type show no translated versions in the Translations tab even though I've created one as a translation of the other. As a result and unlike what happens with all other pages on my website, <% if Translations %> apparently never yields a "true", which prevents the language switcher that I've implemented from appearing.
Are there any modifications that I should do in a _config.php file? And if yes, which file is it?
Thank you for any input.
25 October 2012 at 8:56am
One situation when this happens when the translation groups are not set correctly. The mapping between the translated versions of the same page does not happen implicitly, instead they are connected via the SiteTree_translationgroups table, where page IDs are associated together via shared TranslationGroupID. There is a description of that here: https://github.com/silverstripe/silverstripe-translatable/blob/master/code/model/Translatable.php#L108
Could you check if that table is populated properly first?
30 October 2012 at 12:35pm
Hi vodoomoth, I'm the maintainer of the translatable module. Sounds strange that its just related to one page type, are any other decorators applied to this type specifically, or does it have any special canView()/canEdit() implementations which might prevent the translations from showing up? Other than that, same guess as Mateusz: The translation groups don't match up, which might've been a user error (creating a new page from scratch, rather than hitting "create translation" on the original). Unfortunately, there's no way to "connect" two pages into the same translation group through the UI after they have been created, so you'll need to work in the database for that one.
Are you on 2.4 or 3.0?
30 December 2012 at 12:48pm Last edited: 30 December 2012 12:57pm
Sorry to both of you, I haven't received a notification that someone has replied to this thread. I've just come back here to report the same problem, launched a search first and discovered that I have already done just that months ago, which is also how I discovered your replies.
I'm using 2.4.7 and I don't plan on moving to 3.0 anytime soon.
Checking the Sitetree_TranslationGroups table, I can see that all pages except MemberProfilePage's have their IDs in a row. Pages that are related to one another have their IDs on the same row of the table.
Even pages that have no counterpart in the second language have their own TranslationGroup row. However, IDs of MemberProfilePage's are nowhere to be seen in the table… which probably explains why those pages yield an empty Translations tab (see attachment).
No, there are no decorators applied to the module. The module isn't even mentioned in mysite/_config.php! I can't see any CanView implementation either. I think at some point, the records didn't make it into the table and it was a silent failure.
As to "a user error (creating a new page from scratch, rather than hitting "create translation" on the original)", no, that can't be: I created all pages myself and I always use the "create translation" button.
I will manually create the rows and I'll see what happens.
31 December 2012 at 7:19am
> I will manually create the rows and I'll see what happens.
I created the rows and the translations appear now in the Translations tab. Nothing bad happened (yet…).
2 January 2013 at 9:20pm
Its hard to provide any more specific advice without seeing the project codebase and database. Can you still reproduce the problem when you create new MemberProfile page records through the CMS UI? How about on a clean (=empty) database?
|Go to Top|