Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Apr 2016 at 08:39 UTC
Updated:
19 May 2016 at 23:04 UTC
Jump to comment: Most recent
Comments
Comment #2
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 #3
madan879 commentedHi,
Please fix the some basic issues suggested by paraview (http://pareview.sh/pareview/httpsgitdrupalorgsandboxextremal2699035git) are below:
FILE: ...review/pareview_temp/plugins/views_results_rendered_entity_inject.inc
---------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------
13 | WARNING | Class name must be prefixed with the project name
| | "ViewsResultsInject"
---------------------------------------------------------------------------
FILE: /var/www/drupal-7-pareview/pareview_temp/README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
29 | WARNING | Line exceeds 80 characters; contains 91 characters
30 | WARNING | Line exceeds 80 characters; contains 111 characters
----------------------------------------------------------------------
FILE: ...review/pareview_temp/plugins/views_results_rendered_entity_inject.inc
---------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------
13 | ERROR | Class name must begin with a capital letter
13 | ERROR | Class name must use UpperCamel naming without underscores
36 | ERROR | Protected method name
| | "views_results_rendered_entity_inject::custom_callback_exists"
| | is not in lowerCamel format
43 | ERROR | Public method name
| | "views_results_rendered_entity_inject::get_value" is not in
| | lowerCamel format
---------------------------------------------------------------------------
Comment #4
extremal commentedHi madan879,
Thanks for the review !
This module interacts with the functionality provided by 'Views' and 'Entity' modules (it overrides the 'Rendered Entity' row plugin).
Hence the errors.
I can change the class name, but won't be able to override existing methods which are not following the lowerCamel format without causing a coding standards error.
Probably this is one of the cases when we can't keep codesniffer happy (unless of course we put @codingStandardsIgnore annotations)
What do you think ?
Comment #5
madan879 commentedHi extremal,
Yes, we can use @codingStandardsIgnoreStart and @codingStandardsIgnoreEnd annotations for specific part of code need to omit for errors...
Comment #6
extremal commentedComment #7
mmowers commentedHi @extremal. Here's a manual code review, based on the Project Application Review Template.
Recommendations/Questions are in bold italics
Manual Review
Comment #8
klausi@mmowers: I think you forgot the status. Since project length is not an application blocker is there anything else missing or is this now RTBC after your review?
Comment #9
mmowers commentedAfter enabling and setting a views row plugin to "Rendered entity with injected custom markup", I get this warning:
Strict warning: Declaration of ViewsResultsInjectPlugin::get_value() should be compatible with entity_views_plugin_row_entity_view::get_value($values, $field = NULL) in require_once() (line 13 of /home/mow/websites/jonmed/sites/all/modules/views_results_inject/plugins/views_results_rendered_entity_inject.inc).
Also, when loading the view on a page, I get these warnings:
Strict warning: Declaration of ViewsResultsInjectPlugin::get_value() should be compatible with entity_views_plugin_row_entity_view::get_value($values, $field = NULL) in require_once() (line 13 of /home/mow/websites/jonmed/sites/all/modules/views_results_inject/plugins/views_results_rendered_entity_inject.inc).
Notice: Undefined property: stdClass::$entity in ViewsResultsInjectPlugin->get_value() (line 45 of /home/mow/websites/jonmed/sites/all/modules/views_results_inject/plugins/views_results_rendered_entity_inject.inc).
And the view itself does not seem to load.
Note that I haven't added any custom code to inject markup. I just enabled the module and set the views row plugin to "Rendered entity with injected custom markup".
It would be good for someone else to test as well to make sure it's not just me.
Changing status to "Needs Work".
Comment #10
extremal commentedHi @mmowers,
Thanks a lot for your review. I missed that because I was testing it in conjunction with search_api_views module which was adding 'entity' field to the results array (http://cgit.drupalcode.org/search_api/tree/contrib/search_api_views/incl...).
In order to make this working with any type of entity (taxonomy term, node etc), I decided to keep the original get_value() method. But that means that the custom callback must be injected before the pre_render() happens (as we need to have the callback injected at this point: http://cgit.drupalcode.org/entity/tree/views/plugins/entity_views_plugin...).
And that means that we should do it straight after the views query runs but before pre_render() starts.
Luckily, there is a hook_views_post_execute() which happens exactly where we need it to happen!
To sum up:
- I've changed instructions of how to use this module (instead of injecting callback in hook_views_pre_render() it should be done in hook_views_post_execute())
- got rid of the get_value() method override
I am hoping that all is working fine now. Please let me know !
Thanks again for testing it ! Much appreciated.
Comment #11
extremal commentedComment #12
braindrift commentedHi extremal,
you should pass the plugin title in
views_results_inject_views_plugins():16through t().Best regards
Comment #13
extremal commentedHi @braindrift,
Thanks, this is done now.
Comment #14
braindrift commentedSince I don't see any issues and the module is not complicated enough to have many issues I set it to RTBC.
Comment #15
braindrift commentedHi @extremal,
you should add a hint to your project page that this module is for developers only since a non developer will not be able to use your module.
Best regards
Comment #16
extremal commentedGood idea. Thanks @braindrift.
Comment #17
th_tushar commentedHi @extremal,
Please update the example code on you module page, as it may cause security vulnerability in the user's site.
User facing text should be passed through
t()function and placeholders should be used instead of string concatenation.Adding the single project promote tag as per the guidelines.
Thanks for your contribution!!
Comment #18
extremal commentedHi @th_tushar,
Thanks, corrected !
Comment #19
braindrift commentedReviewed and suggestions from #17 were implemented on module page and in README. So again to RTBC
Comment #20
klausiLooks good to me! Since extremal has quite a few other contributions also I think we can fully approve him.
Thanks for your contribution, extremal!
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.