Jump to:

10993 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » MemberProfile Page – not "translatable"?

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 773 Views
  • vodoomoth
    Avatar
    Community Member
    22 Posts

    MemberProfile Page – not "translatable"? Link to this post

    Hi all,

    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.

  • MateuszU
    Avatar
    Community Member
    89 Posts

    Re: MemberProfile Page – not "translatable"? Link to this post

    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?

    m

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: MemberProfile Page – not "translatable"? Link to this post

    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?

  • vodoomoth
    Avatar
    Community Member
    22 Posts

    Re: MemberProfile Page – not "translatable"? Link to this post

    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.

    Attached Files
  • vodoomoth
    Avatar
    Community Member
    22 Posts

    Re: MemberProfile Page – not "translatable"? Link to this post

    > 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…).

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: MemberProfile Page – not "translatable"? Link to this post

    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?

    773 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.