The "Upload to new gallery" workflow currently adds an empty gallery while rendering the page. The Gallery should only be created if an image is actually uploaded.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | ng3-workflow-followup3.patch | 7.52 KB | scroogie |
| #7 | ng3-workflow-followup2.patch | 7.52 KB | scroogie |
| #1 | ng3-workflow-followup.patch | 7.21 KB | scroogie |
Comments
Comment #1
scroogie commentedWith this patch, the gallery is created on the first upload. It uses a synchronous page request to set the nid of the created gallery. The patch also changes the newly created galleries to be unpublished, because otherwise visitors will see a partial gallery if they visit during the upload. Instead of an empty title, the galleries are called "Unnamed gallery", because the administrative interface relies on the title to display links to the nodes.
The only problem I see with this patch is that it uses drupal_set_message to display the help text, but I couldn't get a help text to work on this URL.
Comment #2
scroogie commentedAs always.
Comment #3
justintime commentedPatch passed the eyeball test, but ran out of time before I could apply it and test it. I should get time to do so tomorrow.
Comment #4
justintime commentedOne quick note, I think we should drupal_set_message() the user about the fact that the gallery needs a title and that it's currently unpublished. Thoughts?
Comment #5
scroogie commentedExcerpt of the patch:
But I do this on the form currently.
Comment #6
justintime commentedClose, but not quite. As UID 1, all worked as it should.
However, as a user whom can create galleries and images, when I use the "wizard", it get a js popup alert stating "Failed to create gallery".
I don't know if it's related or not (quite possibly it is), but marking the gallery as unpublished is probably something we don't want to do. Only users with 'administer nodes' permissions can change the publish status IIRC.
Comment #7
scroogie commentedAh, true. I always use additional access control modules, thats why I didn't think about that. Now that you mentioned it, I remember. Unfortunately I think it didn't even make it into D7. :/
I let the status untouched now. The real cause of your error was a typo in the page callback (using array('type', $gallery_type) instead of array('type' => $gallery_type)). I really need to start testing with custom users. I used this additional revision to refine the error handling a bit.
Comment #8
scroogie commentedTime for another review.
Comment #9
scroogie commentedMissed one place when refactoring the error message. This one is really for review.
Comment #10
justintime commentedThis last one does work for me. I think this patch is a great opportunity to become your first official commit to the project. Before you do, point the coder module at your patch (it found two minor issues), and then commit the result. Welcome to the project (officially)!
Comment #11
scroogie commentedCommited to dev. Yay \o/. I hope I didn't break anything. ;)
Comment #12
oxford-dev commentedIm getting 'Failed to create Gallery: Request failed' with the latest patch and the latest dev.
Comment #13
scroogie commentedoxford-dev: Please open a new issue including detailed browser information.