Closed
Bug 477715
Opened 16 years ago
Closed 16 years ago
[W-1.4.*] Collection Management Scaffolding
Categories
(addons.mozilla.org Graveyard :: Collections, defect)
addons.mozilla.org Graveyard
Collections
Tracking
(Not tracked)
VERIFIED
FIXED
BW-M1
People
(Reporter: fligtar, Assigned: rdoherty)
References
()
Details
Attachments
(1 file, 1 obsolete file)
25.82 KB,
patch
|
lorchard
:
review+
|
Details | Diff | Splinter Review |
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.
Reporter | ||
Updated•16 years ago
|
Assignee | ||
Comment 1•16 years ago
|
||
Attachment #362803 -
Flags: review?(lorchard)
Comment 2•16 years ago
|
||
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.
Assignee | ||
Comment 3•16 years ago
|
||
(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.
Comment 4•16 years ago
|
||
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.
Comment 5•16 years ago
|
||
Hmm, though I suppose I could just do a join and look up the user with a role of COLLECTION_ROLE_OWNER.
Assignee | ||
Comment 6•16 years ago
|
||
(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 :)
Comment 7•16 years ago
|
||
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.
Assignee | ||
Comment 8•16 years ago
|
||
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 9•16 years ago
|
||
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+
Assignee | ||
Comment 10•16 years ago
|
||
(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.
Assignee | ||
Comment 11•16 years ago
|
||
r22382, will file IT bug for SQL updates
Assignee | ||
Updated•16 years ago
|
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 12•16 years ago
|
||
Cool - I can add addons! r++
Reporter | ||
Comment 13•16 years ago
|
||
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
Updated•9 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•