Closed Bug 477715 Opened 16 years ago Closed 16 years ago

[W-1.4.*] Collection Management Scaffolding

Categories

(addons.mozilla.org Graveyard :: Collections, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: fligtar, Assigned: rdoherty)

References

()

Details

Attachments

(1 file, 1 obsolete file)

Scaffolding: Each collection can have its name, description, and directory listing checkbox modified. Additional users can also be given Owner or Publisher roles to each collection. Collections can be deleted.
Attached patch sanity patch (obsolete) — Splinter Review
Attachment #362803 - Flags: review?(lorchard)
Comment on attachment 362803 [details] [diff] [review] sanity patch Patch applied fine, and the new user roles stuff answers some questions I was about to ask about the API. But, I had some problems: * In site/app/config/sql/remora.sql, a constraint is removed from the end of the CREATE TABLE for collections. There's a trailing comma after INDEX (`listed`) that needs to be removed, causing a syntax error otherwise. * In the User model, the getCollections() method throws an undefined variable warning for $collections when $collectionIds is empty, because it only gets defined inside that conditional. * Probably related, there's also an invalid argument warning (not an array) in a foreach in site/app/views/collections/index.thtml in the "Your Collections" section. * When a user creates a collection, they should probably be added as admin (at least) and as a subscriber (maybe) automatically. * Adding a non-existent user to a collection throws a SQL error. Error checking needed eventually. * Subscribing with an already-subscribed user throws a SQL error. Error checking needed eventually. * I can't unsubscribe from a collection. * I can't delete a collection. * As with other patches, I had to dig around in the controller to discover the methods - eg. no links to add / edit collections. It's just scaffolding, but it's hard to get to the important parts from the index. Might be a hurdle for Briks as they develop the extension using the scaffold and API.
(In reply to comment #2) > (From update of attachment 362803 [details] [diff] [review]) > Patch applied fine, and the new user roles stuff answers some questions I was > about to ask about the API. > > But, I had some problems: Will fix them and have a new patch later today.
Also, looking at the collections table, you removed the user_id column in favor of roles but I still need it to supply a "creator" field for the collection in the API.
Hmm, though I suppose I could just do a join and look up the user with a role of COLLECTION_ROLE_OWNER.
(In reply to comment #5) > Hmm, though I suppose I could just do a join and look up the user with a role > of COLLECTION_ROLE_OWNER. Yeah, I was about to say that :)
Also, you probably want to escape / validate the variables included in SQL in the collection.php model - they look SQL-injection ready. I haven't tried it yet, but I suspect I could pull a Bobby Tables with the collection ID passed in via the URL.
Attached patch Sanity patchSplinter Review
New patch with fixes and functionality requested. SQL injection isn't possible as input is sanitized in controller. The SQL errors for subscriptions and adding users I'm not going to bother with as this is just scaffolding.
Attachment #362803 - Attachment is obsolete: true
Attachment #362971 - Flags: review?(lorchard)
Attachment #362803 - Flags: review?(lorchard)
Comment on attachment 362971 [details] [diff] [review] Sanity patch Hmm... Applied the patch fine, and everything works well except one last thing: How do I add/remove addons in a collection? Or are we just doing that in the API for now? (I could be confused)
Attachment #362971 - Flags: review?(lorchard) → review+
(In reply to comment #9) > (From update of attachment 362971 [details] [diff] [review]) > Hmm... Applied the patch fine, and everything works well except one last > thing: > > How do I add/remove addons in a collection? Or are we just doing that in the > API for now? (I could be confused) On the add-on view page, in the right column there is a section 'Add to a collection:' that allows you to do this.
r22382, will file IT bug for SQL updates
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Cool - I can add addons! r++
Thanks Ryan and Les! Looking forward to playing with this.
Verified FIXED; scaffolding's in, and we've been filing bugs as we test.
Status: RESOLVED → VERIFIED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: