3093 Posts in 875 Topics by 654 members
| Go to End | Next > | |
| Author | Topic: | 2592 Views |
-
Adding Comments to DataObjects

22 March 2011 at 1:24pm
Hi guys,
Is there a way to extend the page comments system to include them with a DataObject?
My project, a user-submitted database of recipes, will require recipes to render on their own page, with comments. I don't want to save the recipes as pages, as I don't want them added to the SiteTree. I'd like to use the existing comments functionality if possible to utilize the anti-spam mechanisms.
-
Re: Adding Comments to DataObjects

22 March 2011 at 4:48pm
Part of the work for 3.0 is to strip out the built in comments system so you could do exactly this. Try the module and see how far you get - https://github.com/silverstripe/silverstripe-comments
-
Re: Adding Comments to DataObjects

24 March 2011 at 3:46am Last edited: 24 March 2011 3:53am
Ahh! Will this is exactly what I need. It will change my life. Actually, Silverstripe 3.0 will change my life.
Unfortunately - this isn't working for me. I've downloaded the module and managed to install it, i.e., got to the stage where the dev/build ran fine, and it's created all the right tables. But my Recipes now won't load up in ModelAdmin (I get DataObject::get_by_id passed a non-numeric ID #" at line 2924 of \core\model\DataObject.php, plus I can't access the Comments section within the CMS.
I got a heap of duplicate class warnings during install so had to temporarily move the existing comment stuff that was causing the conflict.
It would be AWESOME if I could use this for this project - but I may need to roll my own.
-
Re: Adding Comments to DataObjects

24 March 2011 at 8:52pm
I got a heap of duplicate class warnings during install so had to temporarily move the existing comment stuff that was causing the conflict.
Hm I was trying to get the module backwards compatible. Haven't used it on 2.4 though saying that (using master to test). Do you have the backtraces for both errors?
It would be AWESOME if I could use this for this project - but I may need to roll my own.
Would be great to get people using this comments module, always better to have 1 solid working module than a bunch of ones with different states of stableness, hopefully the issues are minor.
-
Re: Adding Comments to DataObjects

27 March 2011 at 5:12am Last edited: 27 March 2011 5:19am
Warnings below, this is trying to install on 2.5.
I've also manually cleared silverstripe-cache to no avail.Warning: There are two files both containing the same class: '../cms/code/CommentAdmin.php' and '../comments/code/CommentAdmin.php'. This might mean that the wrong code is being used. in ..\sapphire\core\ManifestBuilder.php on line 487
Warning: There are two files both containing the same class: '../cms/code/sitefeatures/SSAkismet.php' and '../comments/code/SSAkismet.php'. This might mean that the wrong code is being used. in ..\sapphire\core\ManifestBuilder.php on line 487
Warning: There are two files both containing the same class: '../cms/code/CommentTableField.php' and '../comments/code/formfields/CommentTableField.php'. This might mean that the wrong code is being used. in ..\sapphire\core\ManifestBuilder.php on line 487
Warning: There are two files both containing the same class: '../cms/code/CommentTableField.php' and '../comments/code/formfields/CommentTableField.php'. This might mean that the wrong code is being used. in ..\sapphire\core\ManifestBuilder.php on line 487
Warning: There are two files both containing the same class: '../cms/code/sitefeatures/Akismet.php' and '../comments/code/thirdparty/Akismet.php'. This might mean that the wrong code is being used. in ..\sapphire\core\ManifestBuilder.php on line 487
Warning: There are two files both containing the same class: '../cms/code/sitefeatures/Akismet.php' and '../comments/code/thirdparty/Akismet.php'. This might mean that the wrong code is being used. in ..\sapphire\core\ManifestBuilder.php on line 487
-
Re: Adding Comments to DataObjects

27 March 2011 at 5:22am
That is stating that you have duplicated a class name...
'../cms/code/CommentAdmin.php'
and
'../comments/code/CommentAdmin.php'simply remove the duplication - either by not duplicating the class or by using a different name for the second class
-
Re: Adding Comments to DataObjects

27 March 2011 at 8:33pm Last edited: 27 March 2011 10:32pm
Hi Swaiba,
Yep I did that when I first installed the comments module, but then ran into further problems with it (see my reply to Willr: I get DataObject::get_by_id passed a non-numeric ID #" at line 2924 of \core\model\DataObject.php, plus I can't access the Comments section within the CMS) - so I uninstalled the module.
Willr mentioned that it should be backwards compatible though, so I thought I'd try again but no joy
-
Re: Adding Comments to DataObjects

28 March 2011 at 1:49am
ok, was just explaining that those errors are easily fixed, search and replace across files to change the name of the classes in the module
| 2592 Views | ||
| Go to Top | Next > |



