7919 Posts in 1358 Topics by 932 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: | 38465 Views |
-
Re: Bug Reports

8 January 2010 at 6:08am Last edited: 8 January 2010 1:52pm
EDIT: Caching was more agressive than I thought. Should have checked again by changing the name back, sorry!
When I use: SortableDataObject::add_sortable_class('HomePageEntry'); I get the following error when doing a dev/build:...
For the rest everything looks fine, thanks for the good work!!!!!!
-
Re: Bug Reports

8 January 2010 at 6:51am
Check your code.. you've got whitespace somewhere. Make sure you're not closing your PHP tags.
-
Re: Bug Reports

9 January 2010 at 4:20am
I've found that it is not possible to have a DataObject that relates to itself.
In my case each product relates to other complimentary products and similar products.
Eg.
class Product extends DataObject
{
static $many_many = array(
'ComplimentaryProducts' => 'Product',
'SimilarProducts' => 'Product'
);
static $belongs_many_many = array(
'ComplimentaryProductsBelong' => 'Product',
'SimilarProductsBelong' => 'Product'
);
...
function getCMSFields() {
$fields = parent::getCMSFields();
$ComplimentaryManager = new ManyManyDataObjectManager(
$this,
'ComplimentaryProducts',
'Product',
array('Name' => 'Name'),
'getCMSFields_forPopup',
'Name != "' . $this->Name . '"'
);
$fields->addFieldToTab("Root.ComplimentaryProducts", $ComplimentaryManager);...
In ModelAdmin when this runs I get 100% CPU usage and the server crashes. I don't get any errors in the Apache, PHP or SS error log. I guess there must be a never ending loop.
Any help would be appreciated.
-
Re: Bug Reports

9 January 2010 at 4:51am
I'll take a look at it.. I'm wondering, however, why you wouldn't just use a CheckboxSetField or MultiSelectField to create that relationship. If products are already managed in ModelAdmin, why create multiple workflows for creating them? The DOM seems like overkill in this case.
-
Re: Bug Reports

9 January 2010 at 4:59am Last edited: 9 January 2010 5:05am
Thanks for the tip about MultiSelectField.
I wanted to pick a solution that makes it easy to select a few dataobjects out of hundreds.
-
Re: Bug Reports

11 January 2010 at 5:28am Last edited: 11 January 2010 5:29am
SimpleHTMLEditorfield: produces something like this:
<div><div>paragraph1</div><div><br></div><div>paragraph2</div></div>
- <br> should be <br /> if I am using some form of xhtml. I could not find a switch to change this behavior.
- for some reason br is encapsulated by div, this makes the code less clean
- Sometimes text does and sometimes text does not get encapsulated by div(s). I think it would be better to encapsulate it in p, and make this standard behavior (so you know what to expect in the output).I consider this a bug, but people might disagree of course
I have now switched to SimpleTinyMCEField because it did not have any of these issues.
-
Re: Bug Reports

11 January 2010 at 7:14am
Yeah, SimpleTinyMCE is the way to go. Those other two tools are fairly immature.
-
Re: Bug Reports

15 January 2010 at 10:42am
I have a nested FiledDataObject manager. Everything behaves ok, but the name under the file pulls the ID and not the caption that I want. This is my code:
new FileDataObjectManager(
$this,
'ImageFiles',
'ImageFile',
'Photo',
array('Caption'=>'Caption')
)
| 38465 Views | ||
| Go to Top | Next > |


