I use node_gallery to share photos of events in family. So a w-e happen, we take 200 pictures, upload all of them by one click in node_gallery, and then…
I wanted users to be able to actually share the photos, its provided by : https://www.drupal.org/node/2321387
I also need a quick way to sort the images in chronological order… while its in a fancy "uploading race" order if nothing is done. So here comes a patch which provide a "Set chronological order" button in the Sort Items tab. Clicking on it will sort the displayed images.
I reported a missing pager in this tab (in https://www.drupal.org/node/2280221), and the display-all workaround, which is very convinient when using this new feature. I would like to be able to bypass paging issues on this feature, to always sort all the gallery while putting it in chronological order.
To finish, the feature is locked by default in the node_gallery other settings.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | node_gallery-set_chronological_order_2345499-3.patch | 5.51 KB | siltaar |
Comments
Comment #1
siltaar commentedComment #2
zengenuity commentedThis is a nice feature, but the patch needs work.
Most important thing: You need to use the t() function correctly and not concatenate strings. The way you have it in this patch would open a XSS vulnerability.
Change this:
t("Unable to find creation date in exif data for: ").$file->title
To this:
t("Unable to find creation date in exif data for: @title", array('@title' =>$file->title))
There are some other places with the same issue.
Next thing: why is the chronological_date_sort() function inside another function. Don't do that. Also, this function needs to respect namespace and start with node_gallery_api.
Finally: Drupal coding standards should be used for spacing.
Comment #3
siltaar commentedWorked on code convention issues.
Comment #4
siltaar commentedComment #5
siltaar commentedSome fixes to come.
Comment #6
siltaar commentedComment #7
siltaar commentedComment #9
zengenuity commentedThanks. This patch needed a decent amount of rework, but I think I have it working. A couple points:
Comment #10
zengenuity commented