When nodes are being generated programatically (eg when using the Feeds module to generate nodes from an RSS feed), the default site license is not being attached to them, even when they are of a content type that should get a CC license.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | creativecommons-user-default2.patch | 1.8 KB | kreynen |
| #10 | creativecommons-user-default.patch | 1.49 KB | toemaz |
| #1 | creativecommons-applyCCprogramatically-729310.patch | 1.03 KB | awjrichards |
Comments
Comment #1
awjrichards commentedI created a patch to remedy the issue - patched against 6.x-1.x-dev from CVS
Comment #2
awjrichards commentedComment #3
toemaz commentedGood catch! Although I didn't test it yet, it does look good.
Comment #4
balleyne commentedThanks for the patch!
I took a look at it last night. It looks good, but one question comes to mind: user defaults.
The module has a feature whereby a user might select their own default licence to override the site defaults. This patch would apply the site default regardless of any user defaults... but I'm not sure if that's actually an issue.
Do you think there are cases where a user might use some tool to generate nodes, and then want their personal defaults to be applied? Or do you think it makes sense just to use the site default here, assuming it's really the system that's creating the nodes (as is the case with your Feed module example)?
Curious to hear your thoughts before applying the patch.
(ps in the long run, I'd like to have licence detection functionality, whereby the CC and Feeds module might be able to work together to detect CC metadata in content that's being "imported" (or uploaded, in other cases) from somewhere else, but that's a mostly separate issue for future versions of the module...)
Comment #5
toemaz commented@balleyne Indeed, I looked over the user defaults. That should come definitely before the site default.
Comment #6
awjrichards commented@balleyne I think you're right, I didn't think about that - it's definitely possible that a user could be somehow programatically creating nodes (eg with Feeds). I think this just needs another elseif clause to check for the user default. I'll try to update this later today unless someone else wants to take a stab!
Comment #7
balleyne commented@awjrichards Yeah, another elseif clause could do it, or we could put that get-the-default-license-or-user-default-if-there-is-one elseif into a method of it's own, because that check is occurring in the licence selection form logic as well.
I don't mind making the change, but I might not get to it until next week. If you get a chance to update it today, go for it, otherwise I'll take care of things in a few days.
Comment #8
turadg commentedAnyone willing to fix this one this week or next for a 1.0 release?
Comment #9
toemaz commentedI'm on it for the moment.
Comment #10
toemaz commentedFind attached. Not tested!
Comment #11
kreynen commentedThere is something wrong with the patch in #10
I manually applied the changes and rerolled the patch. I would really like to get this into the 1.0 release, but this needs more testing.
Comment #12
awjrichards commentedThis patch appears to be working nicely. Tested with drush generate-content.
First, I set up a new Drupal environment, enable three CC license schemes. Chose one to be the site default, set up a second user and selected a different license for that user's default.
To test that site defaults were being honored:
This showed the expected CC license on the nodes.
To test the user defaults were being honored, I set up a test user (if you're testing along, be sure to set appropriate user permissions), applied a different default CC license for that user (relative to the site default) and ran:
This showed the expected CC license on the nodes.
Comment #13
kreynen commented