7921 Posts in 1359 Topics by 933 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Bug Reports
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 38521 Views |
-
Re: Bug Reports

7 June 2010 at 3:44pm
SS 2.3.6
SWFUpload r369 (I tried r375 too but that didn't seem to fix the issue)This line in the swfupload/_config doesn't seem to be pulling from my php.ini and gives me a 20MB max upload warning:
'file_size_limit' => str_replace("M","MB",ini_get('upload_max_filesize')),
I did change swfupload/_config to this, which works, but would be nice if the other way worked too:
'file_size_limit' => '80MB',
Thank you
-
Re: Bug Reports

7 June 2010 at 4:52pm
What do you mean it's not pulling from php.ini? What value is being returned? Keep in mind that with most PHP configurations, it is not possible to modify upload_max_filesize with ini_set() or with htaccess directives.
-
Re: Bug Reports

8 June 2010 at 1:26pm
Well, in the past, using things like Slide Show Pro (on different host), I often had to upload a php.ini file to override the upload_max_filesize & post_max_size settings. It looks like the 20M value it's returning is the hosts default limit. So I guess my php.ini isn't really overriding.
Sorry for the false alarm.
-
Re: Bug Reports

10 June 2010 at 4:01am Last edited: 16 June 2010 7:36pm
Bug in HasManyDataObjectManager
public static $summary_fields = array(
'Rating' => 'Rating',
'Member.Email' => 'Email'
);SQL error: Unknown field Member.Email in fieldlist
$oFieldSet->addFieldToTab(
'Root.Ratings',
new HasManyDataObjectManager(
$this,
'Ratings',
'Rating'
)
);Works fine:
$oFieldSet->addFieldToTab(
'Root.Ratings',
new HasManyComplexTableField(
$this,
'Ratings',
'Rating'
)
); -
Re: Bug Reports

10 June 2010 at 3:46pm
Hi Uncle Cheese,
Awesome Module,
I am having a small problem with the latest trunk build on the current 2.4 release.
When in Dev mode the ManyManyDataObjectManager generates the following error however when in live mode it works as expected.
[Warning] Missing argument 3 for ComplexTableField_Item::__construct(), called in /var/www/vhosts/xxxx.com/httpdocs/xxxx/dataobject_manager/code/DataObjectManager.php on line 585 and defined
GET /xxxx/admin?flush=1
Line 1004 in /var/www/vhosts/xxxx.com/httpdocs/xxxx/sapphire/forms/ComplexTableField.php
Any ideas, let me know if you need more information.
-
Re: Bug Reports

15 June 2010 at 1:37am Last edited: 15 June 2010 1:39am
Hi UncleCheese,
I'm trying to (mis)use ManyManyDataObjectManager to manage a relation on an extension of the Member class. However, I get the error:
[User Warning] Can't figure out the data class of
GET /testss/admin/security/EditForm/field/Members/item/2/editLine 28 in G:\localhost\testss\dataobject_manager\code\HasManyDataObjectManager.php
Also the SimpleHTMLEditorField doesn't work in the Members pop-up.Below a simplified test case of the code. The ManyManyDataObjectManager in Page works find, it's the one on Members that breaks. This error doesn't have a high priority for me as I've found a work around from your thread on http://silverstripe.org/customising-the-cms/show/252445?start=0#post252457, but I thought I would report it to you anyway in case it affects other issues too.
Edit: I've tested this with the latest revision (399).
_config.php
DataObject::add_extension('Member', 'Expert');
mysite\code\Expert.php
<?php
class Expert extends Extension {
static $singular_name = 'Expert';
static $plural_name = 'Experts';function extraStatics() {
return array(
'db' => array(
'Description' => 'HTMLText',
'TitleName' => 'Text',
),
'many_many' => array(
'Pages' => 'Page',
),
'has_one' => array(
'Thumbnail' => 'Image'
),
);
}public function getCMSFields() {
$fields = parent::getCMSFields();
$this->extend('updateCMSFields', $fields);
return $fields;
}public function updateCMSFields(&$fields) {
$fields->addFieldToTab("Root.Main", new TextField('TitleName', 'Academic title'), "FirstName");
$fields->addFieldToTab("Root.Description", new SimpleHTMLEditorField("Description", "Description"));//This does work and shows the many many relation is working
$fields->addFieldToTab("Root.Pages",new CheckboxSetField('Pages','Pages (check all that apply)', DataObject::get("Page")->toDropdownMap()));$domPages = new ManyManyDataObjectManager($this, "Pages", "Page", array('Title' => 'Title'), "getCMSFields_forPopup", '', 'Surname ASC');
$fields->addFieldToTab("Root.Pages", $domPages);$fields->addFieldToTab("Root.Thumbnail", new ImageField('Thumbnail', 'Thumbnail'));
return $fields;
}function getCMSFields_forPopup() {
$fields = new FieldSet(
new TextField("Surname", "Surname")
);
return $fields;
}
}mysite/code/Page.php
<?php
class Page extends SiteTree {
static $belongs_many_many = array(
'Members' => 'Member',
);function getCMSFields() {
$fields = parent::getCMSFields();// It works fine from here
$manager = new ManyManyDataObjectManager($this, "Members", "Member", array('Surname' => 'Surname'), "getCMSFields_forPopup", "", "Surname ASC");
$manager->setPermissions(array());
$fields->addFieldToTab("Root.Content.Experts", $manager);return $fields;
}function getCMSFields_forPopup() {
$fields = new FieldSet(
new TextField("Title", "Title")
);
return $fields;
}
}class Page_Controller extends ContentController {
/**
* An array of actions that can be accessed via a request. Each array element should be an action name, and the
* permissions or conditions required to allow the user to access it.
*
* <code>
* array (
* 'action', // anyone can access this action
* 'action' => true, // same as above
* 'action' => 'ADMIN', // you must have ADMIN permissions to access this action
* 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true
* );
* </code>
*
* @var array
*/
public static $allowed_actions = array (
);public function init() {
parent::init();// Note: you should use SS template require tags inside your templates
// instead of putting Requirements calls here. However these are
// included so that our older themes still work
Requirements::themedCSS('layout');
Requirements::themedCSS('typography');
Requirements::themedCSS('form');
}
}
| 38521 Views | ||
| Go to Top | Next > |




