Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » DataObjectManager SS v2.3.3 I can't handle sub-URLs...

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 3258 Views
  • wardog
    Avatar
    Community Member
    9 Posts

    DataObjectManager SS v2.3.3 I can't handle sub-URLs... Link to this post

    How about the following error and I do not know how you can correct ..
    I created a small gallery with DataObjectManager module .. And I have a multi-language service .. but when I step to the second language I get the following error ..

    "I can't handle sub-URLs of a CMSMain object."

    From what I've read I understand it is because it is the same object and not exceeding the premises but do not understand how to fix it .. if anyone can help me I will be grateful

  • FullWebService
    Avatar
    Community Member
    36 Posts

    Re: DataObjectManager SS v2.3.3 I can't handle sub-URLs... Link to this post

    I bumped into the same problem, but found a fix.

    Change the if-statement on line 88 of /cms/code/CMSMain.php to:

    if(Translatable::is_enabled()) {
       // $Lang serves as a "context" which can be inspected by Translatable - hence it
       // has the same name as the database property on Translatable.
       if($this->getRequest()->requestVar("Locale")) {
          $this->Locale = $this->getRequest()->requestVar("Locale");
       } elseif($this->getRequest()->requestVar("locale")) {
          $this->Locale = $this->getRequest()->requestVar("locale");
        } elseif (Session::get("{$this->class}.Locale")) {
          $this->Locale = Session::get("{$this->class}.Locale");    
       } else {
          $this->Locale = Translatable::default_locale();
       }
       Translatable::set_current_locale($this->Locale);
       Session::set("{$this->class}.Locale", $this->Locale);
    }

    This should do the trick. (See patch for 2.3.2 http://open.silverstripe.com/attachment/ticket/4199/CMSMain.patch)

    And thanks to UncleCheese, the DataObjectManager is excellent.

  • UncleCheese
    Avatar
    4085 Posts

    Re: DataObjectManager SS v2.3.3 I can't handle sub-URLs... Link to this post

    Wow. Thanks. Great to have this finally resolved. Did you submit a patch to SS?

  • FullWebService
    Avatar
    Community Member
    36 Posts

    Re: DataObjectManager SS v2.3.3 I can't handle sub-URLs... Link to this post

    I'm ashamed to say I have no idea how these patch things work.

    I just go through the red and green lines and manualy update my code.

    If you want to/can make a patch for this issue to help others with the same problem, that would be great. If you can point me to some directions on how to handle patches, that would be awesome.

  • UncleCheese
    Avatar
    4085 Posts

    Re: DataObjectManager SS v2.3.3 I can't handle sub-URLs... Link to this post

    You can submit a bug to open.silverstripe.com. Just don't mention anything about DataObjectManager, because they'll often blame the module for having the bug, not their own code.

  • ChrisBryer
    Avatar
    Community Member
    95 Posts

    Re: DataObjectManager SS v2.3.3 I can't handle sub-URLs... Link to this post

    sorry to chime in so late.. there's already a sudo-patch for the problem, which gets around things the same way, and it is ticket #4199.

    i think SS has been holding off on the fix because they want to stay away from session variables in the translatable code and it may also be affected by modelAdmin (what is the interface for modeladmin and translatable dataobjects?) as well as heirarchical urls.. i think thats what i read from a lot of discussions.

    -Chris

  • keeny
    Avatar
    Community Member
    48 Posts

    Re: DataObjectManager SS v2.3.3 I can't handle sub-URLs... Link to this post

    I'm getting the same error "I can't handle sub-URLs of a CMSMain object." In the popup window of a DOM when I try to save the DataObject.

    The url that the popup is trying to post to is:

    <form id="DataObjectManager_Popup_DetailForm" action="admin/EditForm/field/Locations/item/28/DetailForm" method="post" enctype="application/x-www-form-urlencoded">

    I tried the CMSMain.php fix with no luck - i'm not using Translatable.

    Is there any way for me to get more info than just this message?

    Thanks,

    Barry.

  • Double-A-Ron
    Avatar
    Community Member
    599 Posts
    3258 Views
Page: 1 2
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.