Strange URLs when used together with GridField #35

Closed
bumbus opened this Issue Jul 13, 2012 · 6 comments

Comments

Projects
None yet
4 participants
@bumbus

bumbus commented Jul 13, 2012

Hi there,
I experienced some strange behaviour using translatable together with the GridField. It throws something like:
Error: "Uncaught InvalidArgumentException: Invalid locale "en_US?locale=en_US?locale=en_US"" at line 299 of ...Translatable.php,
It seems to mess up the get vars here.
if i try to add a new Item to the GridField. Dont knwo if i m missing something here, or this is a bug actually

EDIT: This problem might be caused by the GridField....

Regards
Sebastian

@chillu

This comment has been minimized.

Show comment
Hide comment
@chillu

chillu Jul 17, 2012

Member

Could you describe what you're doing to get to this point?
Query construction in core is quite limited, the ?locale parameter tends to throw it off.

Member

chillu commented Jul 17, 2012

Could you describe what you're doing to get to this point?
Query construction in core is quite limited, the ?locale parameter tends to throw it off.

@bumbus

This comment has been minimized.

Show comment
Hide comment
@bumbus

bumbus Jul 17, 2012

Hi,
it happens directely after hitting the "Add Button" of the GridField. The URL changes to:
..../admin/pages/edit/EditForm/field/Images/item/new?locale=en_US?locale=en_US
and it throws this error this posted above, in this new growl-style notification field.
I hope that helps.

PS: Viele Grüße aus Bonn übrigends :)

bumbus commented Jul 17, 2012

Hi,
it happens directely after hitting the "Add Button" of the GridField. The URL changes to:
..../admin/pages/edit/EditForm/field/Images/item/new?locale=en_US?locale=en_US
and it throws this error this posted above, in this new growl-style notification field.
I hope that helps.

PS: Viele Grüße aus Bonn übrigends :)

@prostart

This comment has been minimized.

Show comment
Hide comment
@prostart

prostart Jul 18, 2012

I am having the same issue. I have a thread running over at the silverstripe site http://www.silverstripe.org/general-questions/show/20267#post315196#post315196. I could really use a fix right away and I am willing to pay for your time to investigate this issue if I can get an answer soon.

Thanks!

I am having the same issue. I have a thread running over at the silverstripe site http://www.silverstripe.org/general-questions/show/20267#post315196#post315196. I could really use a fix right away and I am willing to pay for your time to investigate this issue if I can get an answer soon.

Thanks!

@silverstripesk

This comment has been minimized.

Show comment
Hide comment
@silverstripesk

silverstripesk Jul 19, 2012

I can confirm this issue (same as on link posted above - with editing page's URL). Default translatable locale is cs_CZ (czech), second language is en_US. When i want edit URL of any page, i get this error:

ERROR [User Error]: Uncaught InvalidArgumentException: Invalid locale "en_US/field/URLSegment/suggest/?value=en"
IN GET /admin/pages/edit/EditForm?locale=en_US/field/URLSegment/suggest/?value=en
Line 299 in /home/.../public_html/translatable/code/model/Translatable.php

I can confirm this issue (same as on link posted above - with editing page's URL). Default translatable locale is cs_CZ (czech), second language is en_US. When i want edit URL of any page, i get this error:

ERROR [User Error]: Uncaught InvalidArgumentException: Invalid locale "en_US/field/URLSegment/suggest/?value=en"
IN GET /admin/pages/edit/EditForm?locale=en_US/field/URLSegment/suggest/?value=en
Line 299 in /home/.../public_html/translatable/code/model/Translatable.php

@chillu

This comment has been minimized.

Show comment
Hide comment
@chillu

chillu Jul 19, 2012

Member

@oktotoker If you're referring to the "deprecated _t()" stuff, that's been fixed in #36

@silverstripesk URLSegment issue: This used to be a problem, but I've fixed it a month or longer ago. Is that with latest 3.0 branch of cms and framework off github?

"Add button" issue with double locale: Can't reproduce. Standard install on 3.0 branch,
with the following added to Page class:

function getCMSFields() {
        $fields = parent::getCMSFields();
        $fields->addFieldToTab('Root.Members',
            GridField::create('Members', 'Members', Member::get(), GridFieldConfig_RecordEditor::create())
        );

        return $fields;
    }

Pressing "Add Member" correctly shows the add form.

In general, please try to stick to one problem per issue, gets a bit confusing otherwise ;)

Member

chillu commented Jul 19, 2012

@oktotoker If you're referring to the "deprecated _t()" stuff, that's been fixed in #36

@silverstripesk URLSegment issue: This used to be a problem, but I've fixed it a month or longer ago. Is that with latest 3.0 branch of cms and framework off github?

"Add button" issue with double locale: Can't reproduce. Standard install on 3.0 branch,
with the following added to Page class:

function getCMSFields() {
        $fields = parent::getCMSFields();
        $fields->addFieldToTab('Root.Members',
            GridField::create('Members', 'Members', Member::get(), GridFieldConfig_RecordEditor::create())
        );

        return $fields;
    }

Pressing "Add Member" correctly shows the add form.

In general, please try to stick to one problem per issue, gets a bit confusing otherwise ;)

@silverstripesk

This comment has been minimized.

Show comment
Hide comment
@silverstripesk

silverstripesk Jul 19, 2012

hi Ingo, i was running stable 3.0 from download section, switching to repo's 3.0 branch fixed this problem. Thanks.

hi Ingo, i was running stable 3.0 from download section, switching to repo's 3.0 branch fixed this problem. Thanks.

@chillu chillu closed this Jul 19, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment