Description :
This module allows you to have a report listing the image styles per image fields and per view modes on all entities.
The report can be accessed at admin/reports/image_styles
Similar module
style usage : Merge request #2314695: Fusion with image_styles_mapping
Differences with style usage
- I take the problem in the other direction. I start from entity to go to the image style, whereas style usage module starts with the image style to go to the place it is used.
- I support scald module
Link to the sandbox :
https://www.drupal.org/sandbox/florenttorregrosa/2310347
Git clone command:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/florenttorregrosa/2310347.git image_styles_mapping
Check with pareview
OK : http://pareview.sh/pareview/httpgitdrupalorgsandboxflorenttorregrosa2310...
Other project application I reviewed
OSM route
Video embed instagram
Availability calendars show availability
Comment | File | Size | Author |
---|---|---|---|
#19 | drupal-review-ism1.jpg | 207.45 KB | hwi2 |
Comments
Comment #1
PA robot CreditAttribution: PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #2
GrimreaperAdd first review of projectapplication
Comment #3
Bartuc CreditAttribution: Bartuc commentedHey, cool looking module!
havehas been allowed in any atom reference fields yet. Or such fields are not used.'), // Or perhaps you meant "atoms"Other than those very minor things, I couldn't find anything else. Looks great!
Comment #4
Bartuc CreditAttribution: Bartuc commentedComment #5
GrimreaperHello Bartuc,
Thanks for the review.
I fix the git clone command.
I will see the other points this evening.
Comment #6
GrimreaperHello,
I have taken into account Bartuc's review and I have added a hook_help.
Thanks for the review.
Comment #7
GrimreaperAdd second review of project application.
Comment #8
pkamerakodi CreditAttribution: pkamerakodi commentedHi,
Please find some review comments below
1) image_styles_mapping_fields_report contains too much of nested loop. I think to make code simpler and moduler it is better to split the it into multiple functions.
2) Same observation in image_styles_mapping_views_fields_report,image_styles_mapping_scald_image_report function also.
3) I feel like we can try using some drupal static variable caching to improve performance since field_info_instances is getting used in multiple places for a single request.
4) Same observations as point 3 for image_styles_mapping_get_image_styles function also.
5) A small code format issue , please add line break above return in image_styles_mapping_search_image_styles function
6) A minor observation if you want to update in image_styles_mapping_display_view_mode_link it is actually a switch for entity type not entity right?
7) Too much of nesting in image_styles_mapping_view_display_link i can u can improve it.
8) Configure all the links as contansts.
Regards,
Prajwal
Comment #9
GrimreaperHi,
Thanks for the review.
1) and 2) Yes, I also found that there is a lot of loops, and I didn't take the time to think of a better way. I will work on that this week.
3) and 4) Thanks for pointing this, I didn't think of it and never use the drupal static variables before. I made an implementation only for image styles, for the other variables, I call the field_info_instances, views_get_all_views etc. functions in the main function and I added parameters to subfuntions.
5) Done
6) Yes, entity type, fixed. I also name it entity_machine_name in the call to the funtion.
7) I removed one level.
8) I do not understand the suggestion. Please, may you explain a little bit more or give a short example ?
Thanks for your review.
Comment #10
pkamerakodi CreditAttribution: pkamerakodi commentedThanks for admin/config/people/accounts/display/ you can define them as constants.
Regards,
Prajwal
Comment #11
GrimreaperHello,
8) I define a constant for the path of this module.
But I don't know if I should do the same thing for admin/config/people/accounts/display/ , admin/structure/taxonomy/ , etc. I looked in the core and some contrib modules very used and I didn't see they define paths in constants.
1) and 2) I searched for a way to improve the code, but I didn't see any as i need to go throught the structure returned by field_info_instances() or views_get_all_views(). I can hide the loops in sub-functions but I think that won't add clarity or improve the performance.
Maybe a way to improve the performance would be making select in the database, but I prefer to avoid that.
If someone as any suggestion.
Thanks again for the review.
Comment #12
GrimreaperAdd third review of project application and adding PAReview: review bonus tag.
Comment #13
er.pushpinderrana CreditAttribution: er.pushpinderrana commented@Grimreaper, thankyou for your contribution.
I appreciate your module idea and your hard work.
Automated Review
Best practice issues identified by pareview.sh / drupalcs / coder. None. Good Job.
Manual Review
Instead of following code:
it should be:
admin/reports/image_styles
rather using separate constant.define('IMAGE_STYLES_MAPPING_REPORT_PATH', 'admin/reports/image_styles');
is not required in this case.admin/reports/image_styles
in .info file usingconfigure=admin/reports/image_styles
to make it directly accessible from module page.The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
Overall your module looks good to me, nice job!
Thanks again for your hard work.
Comment #14
GrimreaperHello er.pushpinderrana,
Thanks for your review.
I think I should have lost my review bonus, according to the review bonus rules https://www.drupal.org/node/1975228 :)
- README.txt : I follow the README template.
Thank you for your review.
Comment #15
pingwin4egAll contributors are encouraged to review as much project applications as they can, and there was no need to remove the bonus tag by yourself;)
Comment #16
GrimreaperAdding orgmode review.
Comment #17
izus CreditAttribution: izus commentedadding the PAReview bonus tag as there are many reviews by Grimreaper
Comment #18
GrimreaperHello,
I have started a D8 version : http://cgit.drupalcode.org/sandbox-florenttorregrosa-2310347/tree/?h=8.x...
git clone --branch 8.x-1.x http://git.drupal.org/sandbox/florenttorregrosa/2310347.git image_styles_mapping
Currently in development. It has not all the features of the D7 version. Should I open a new project application issue when the D8 version will be ready or should I use this one with a double tag [D7][D8] ?
Comment #19
hwi2 CreditAttribution: hwi2 commentedGrimreaper, this is a great idea for a module and it works great, but one thing about the presentation of it could use improvement (see my attached screenshot). The columns need to be the same widths, if possible. I know that some tables have different number of columns. but the report looks a sloppy to me with all different widths.
One possible solution:
Add some DIVs to the presentation with an included CSS file then add drupal_add_css() to line up the tables.
One more suggestion: Please add the reports link to your README.TXT file as well. I had to search for the URL and finally found it in your .info file, but non-programmers will not search there, so it needs to be more obvious.
Other than that, it is a great module and thank you for this contribution! I will be using your module on all my clients' websites.
Bruce
Comment #20
GrimreaperHello hwi2,
Thanks for your review.
Did you clear your caches after enabling the module ?
Because, normally, it provides a link in 'reports' from the administration (management) menu.
The link to the report can also be accessed in configure of the module, in the help of the module and it is indicated on the project page (I will make it in bold).
For the columns width: yes, it is a little bit disturbing, especially when there are the scald tables but the report is still usable. I was wondering to separate the tables on multiple URL, one table per URL.
I'm not very motivated to add CSS, I prefer the default behavior because I can't anticipate the names of entities, bundles, views, etc...
Thanks again for your review and enthusiasm.
Comment #21
hwi2 CreditAttribution: hwi2 commentedThanks, GR. Great work!
Bruce
Comment #22
GrimreaperHello,
I have splitted the report in multiple reports and multiple files. So now, no problem of columns width consistancy.
Hoping it will be good this time.
Comment #23
er.pushpinderrana CreditAttribution: er.pushpinderrana commentedAutomated Review
Best practice issues identified by pareview.sh / drupalcs / coder. Few minor issues that need to be fix.
Manual Review
admin/reports/image_styles
) in .info file, need to be fix.admin/reports/image_styles_mapping/views_scald
page.Notice: Undefined variable: check in image_styles_mapping_field_is_in_fields() (line 202 of C:\xampp\htdocs\drupal731\sites\all\modules\2310347\image_styles_mapping.module).
recommanded
.The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
@Grimreaper, I appreciate your hard work and coding standard. From above issues are I am not seeing anything to prevent RTBC, but these needs to be fixed before stable release.
Even you have also started to develop this module for D8, that's really good.
I am not the right person to answer this question but as I understand there is no need to open a new project application issue for D8 module, once this D7 module get pass through this process you can do these enhancement at later stage.
Thanks again for your hard work!
Comment #24
GrimreaperAutomated review : copy/past from the D8 version, indentation problem. Fixed.
Manual review :
1) : thanks for pointing it, I forgot to change it when I split into individual reports. Fixed
2) : I think it is easy for translation as the strings in t() can be translated more easily. But maybe it is a bad practice, I don't know, as I translate for french group on localize.org, when I see strings with most of their parts in common, I think that's more work for translation.
3) initialization $check = FALSE : fixed, thanks for pointing this.
4) Thanks for pointing this : fixed, also fixed on project page (I will also need to fix it for the D8 version)
Thanks you very much for your review.
Comment #25
mpdonadioAutomated Review
Review of the 7.x-1.x branch (commit 191ebcf):
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
Manual Review
Explicitly tested some XSS vectors w/o problems.
(+) The URL in image_styles_mapping_help() should not include the leading slash.
(+) Avoid breaking translatable strings across lines.
(+) image_styles_mapping_get_image_styles() needs a proper docblock with a @return
(+) image_styles_mapping_get_image_fields() needs a proper docblock with a @return
More missing docblock info. Fix these when you can.
(+) Your hook_menu() implies the existence of module that may not be enabled. For example admin/reports/image_styles_mapping/views, will run the views support w/o checking to see if Views is enabled and will throw a Fatal. You need to feature detect these links.
image_styles_mapping_reports_overview(). I think this router item can simply be
Also, in mene router callbacks, it is best to hust return a render array, rather than calling theme().
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
The 7.x branch has the possibility for some pretty big fatals in them, but those are bugs and not blocking issues. I am not seeing any blockers. The links in the reports all look XSS safe (they are build via l()), and the other row elements are machine names, which are alpha+underscore (cf, field_ui_fields_list() for $items['admin/reports/fields'] in core).
If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.
This review uses the Project Application Review Template.
Comment #26
GrimreaperHi mpdonadio,
Thank you for the review.
Thank you very much, I didn't know that tip. But as I restructured the menu links, I no more need it, but I keep it in mind.
Thank you for the review.
Comment #27
mpdonadioThe direct call to theme() was in image_styles_mapping_reports_overview(), line 18.
Comment #28
mpdonadioAutomated Review
Review of the 7.x-1.x branch (commit 11c4884):
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
Manual Review
Looks like all of my (+) issues were addressed, except that image_styles_mapping_help() still has a translatable
string broken across lines.
I like the change to local tasks.
Read `git diff 191ebcf..` as well as another visual pass. Not seeing any blocking issues, and no objecttion to RTBC for a few days.
Per an IRC conversation with @klausi, we agreed that we do not need to do a review of the 8.x branch, as the API is still in flux.
Comment #29
mpdonadioThanks for your contribution, Grimreaper!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #30
GrimreaperHello @mpdonadio,
Thank you very much. Thanks to @klausi. And thanks to all reviewers.