Short description:
Views Inject View Results module allows to inject results into view from other view.
The results are injected at position set as per 'position' field which should be in filtered content type - for the view that is to be injected.
The injected results will remain in fixed position (value of the 'position' field) while the primary view results will 'roll' around.

Use-case:
The news timeline with injected adds, where the adds are in fixed position and news are sorted by publish date and rolling around the adds.

How does it work:
Adjust 'main view' query for the rows to be injected.
Insert rows from 'view to inject' into 'main view' results.
Rows to be injected contain extra info with view: name, display_id and order_field: table and field.
The extended views style plugin render_fields() is able to switch the view and display if it finds above mentioned extra info.
This way user has total flexibility to theme/style the results from both views independently.

Project page link: https://www.drupal.org/sandbox/michael_dajewski/2896782

Git clone command:

git clone --branch 7.x-1.x https://git.drupal.org/sandbox/michael_dajewski/2896782.git views_inject_view_results

Comments

Michael Dajewski created an issue. See original summary.

PA robot’s picture

Issue summary: View changes
Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpsgitdrupalorgsandboxmichael_dajewski2896...

Fixed the git clone URL in the issue summary for non-maintainer users.

We 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.

Michael Dajewski’s picture

Status: Needs work » Needs review

Fixed majority of reported errors.
RE: some errors in views plugins.
Suggested corrections would make the declarations incompatible with parent declarations.

jonnyhocks’s picture

Status: Needs review » Needs work

Running https://git.drupal.org/sandbox/michael_dajewski/2896782.git through Code Sniffer is reporting numerous issues that are recommended fixes.

Link to review report

Michael Dajewski’s picture

Status: Needs work » Needs review

@jonnyhocks thanks for the comment.

RE:

FILE: .../plugins/views_inject_view_results_views_plugin_display_extender.inc
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------
35 | WARNING | Do not use the raw $form_state['input'], use
| | $form_state['values'] instead where possible
35 | WARNING | Do not use the raw $form_state['input'], use
| | $form_state['values'] instead where possible
85 | WARNING | Do not use the raw $form_state['input'], use
| | $form_state['values'] instead where possible
85 | WARNING | Do not use the raw $form_state['input'], use
| | $form_state['values'] instead where possible
--------------------------------------------------------------------------

Cannot use $form_state['values'] because it is not available.

RE:

FILE: .../plugins/views_inject_view_results_views_plugin_display_extender.inc
--------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------
21 | ERROR | [ ] Method name
| | "ViewsInjectViewResultsViewsPluginDisplayExtender::options_definition_alter"
| | is not in lowerCamel format
21 | ERROR | [x] Visibility must be declared on method
| | "options_definition_alter"
30 | ERROR | [ ] Method name
| | "ViewsInjectViewResultsViewsPluginDisplayExtender::options_form"
| | is not in lowerCamel format
30 | ERROR | [x] Visibility must be declared on method "options_form"
107 | ERROR | [ ] Method name
| | "ViewsInjectViewResultsViewsPluginDisplayExtender::options_submit"
| | is not in lowerCamel format
107 | ERROR | [x] Visibility must be declared on method "options_submit"
125 | ERROR | [ ] Method name
| | "ViewsInjectViewResultsViewsPluginDisplayExtender::options_summary"
| | is not in lowerCamel format
125 | ERROR | [x] Visibility must be declared on method
| | "options_summary"
--------------------------------------------------------------------------

and

FILE: ..._temp/views/plugins/views_inject_view_results_views_plugin_style.inc
--------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------
25 | ERROR | [ ] Class property $row_tokens should use lowerCamel naming
| | without underscores
25 | ERROR | [x] The var keyword must not be used to declare a property
25 | ERROR | [ ] Visibility must be declared on property "$row_tokens"
32 | ERROR | [ ] Class property $row_plugin should use lowerCamel naming
| | without underscores
32 | ERROR | [x] The var keyword must not be used to declare a property
32 | ERROR | [ ] Visibility must be declared on property "$row_plugin"
48 | ERROR | [ ] Method name
| | "ViewsInjectViewResultsViewsPluginStyle::render_grouping_sets"
| | is not in lowerCamel format
48 | ERROR | [ ] Type hint "array" missing for $sets
48 | ERROR | [x] Visibility must be declared on method
| | "render_grouping_sets"
85 | ERROR | [ ] Method name
| | "ViewsInjectViewResultsViewsPluginStyle::render_fields"
| | is not in lowerCamel format
85 | ERROR | [ ] Type hint "array" missing for $result
85 | ERROR | [x] Visibility must be declared on method "render_fields"
--------------------------------------------------------------------------

"Method name ... is not in lowerCamel format" errors do not apply since the methods are defined in the parent class (see: views module).
"Visibility must be declared on method/property" errors. The default visibility is public. All methods are declared in views module without 'visibility'.
"The var keyword must not be used to declare a property" errors - again this is how the properties are declared in the parrent classes - see views module.
"Type hint "array" missing for [variable_name]" error. Using hint would make render_grouping_sets() method incompatible with definition in the parent class.

RE:

 FILE: ...t/repos/pareviewsh/pareview_temp/views_inject_view_results.views.inc
--------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------
36 | ERROR | Missing parameter type
38 | ERROR | Missing parameter type
56 | ERROR | Missing parameter type
-------------------------------------------------------------------------- 

These lines are in doc blocks:

 * @param $form
 * @param $form_state

I do not see nowhere in the core code nor in views module above comments adding parameter type.

Michael Dajewski’s picture

Priority: Normal » Major
sleitner’s picture

Priority: Major » Normal
Status: Needs review » Needs work

Automated Review

Review of the 7.x-1.x branch (commit 2ef371b):

  • Your README.txt does not follow best practices (headings need to be uppercase). See https://www.drupal.org/node/2181737 .
    • The INTRODUCTION section is missing.
    • The REQUIREMENTS section is missing.
    • The INSTALLATION section is missing.
    • The CONFIGURATION section is missing.
  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
  • DrupalPractice has found some issues with your code, but could be false positives.
    
    FILE: .../plugins/views_inject_view_results_views_plugin_display_extender.inc
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------
     35 | WARNING | Do not use the raw $form_state['input'], use
        |         | $form_state['values'] instead where possible
     35 | WARNING | Do not use the raw $form_state['input'], use
        |         | $form_state['values'] instead where possible
     85 | WARNING | Do not use the raw $form_state['input'], use
        |         | $form_state['values'] instead where possible
     85 | WARNING | Do not use the raw $form_state['input'], use
        |         | $form_state['values'] instead where possible
    --------------------------------------------------------------------------
    
    Time: 812ms; Memory: 4Mb
    
  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script.


FILE: .../drupal/pareviewsh/pareview_temp/views_inject_view_results.views.inc
--------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------
 36 | ERROR | Missing parameter type
 38 | ERROR | Missing parameter type
 56 | ERROR | Missing parameter type
--------------------------------------------------------------------------


FILE: .../plugins/views_inject_view_results_views_plugin_display_extender.inc
--------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------
  21 | ERROR | [x] Visibility must be declared on method
     |       |     "options_definition_alter"
  21 | ERROR | [ ] Method name
     |       |     "ViewsInjectViewResultsViewsPluginDisplayExtender::options_definition_alter"
     |       |     is not in lowerCamel format
  30 | ERROR | [x] Visibility must be declared on method "options_form"
  30 | ERROR | [ ] Method name
     |       |     "ViewsInjectViewResultsViewsPluginDisplayExtender::options_form"
     |       |     is not in lowerCamel format
 107 | ERROR | [x] Visibility must be declared on method "options_submit"
 107 | ERROR | [ ] Method name
     |       |     "ViewsInjectViewResultsViewsPluginDisplayExtender::options_submit"
     |       |     is not in lowerCamel format
 125 | ERROR | [x] Visibility must be declared on method
     |       |     "options_summary"
 125 | ERROR | [ ] Method name
     |       |     "ViewsInjectViewResultsViewsPluginDisplayExtender::options_summary"
     |       |     is not in lowerCamel format
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ..._temp/views/plugins/views_inject_view_results_views_plugin_style.inc
--------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------
 25 | ERROR | [ ] Class property $row_tokens should use lowerCamel naming
    |       |     without underscores
 25 | ERROR | [x] The var keyword must not be used to declare a property
 25 | ERROR | [ ] Visibility must be declared on property "$row_tokens"
 32 | ERROR | [ ] Class property $row_plugin should use lowerCamel naming
    |       |     without underscores
 32 | ERROR | [x] The var keyword must not be used to declare a property
 32 | ERROR | [ ] Visibility must be declared on property "$row_plugin"
 48 | ERROR | [x] Visibility must be declared on method
    |       |     "render_grouping_sets"
 48 | ERROR | [ ] Type hint "array" missing for $sets
 48 | ERROR | [ ] Method name
    |       |     "ViewsInjectViewResultsViewsPluginStyle::render_grouping_sets"
    |       |     is not in lowerCamel format
 85 | ERROR | [x] Visibility must be declared on method "render_fields"
 85 | ERROR | [ ] Type hint "array" missing for $result
 85 | ERROR | [ ] Method name
    |       |     "ViewsInjectViewResultsViewsPluginStyle::render_fields"
    |       |     is not in lowerCamel format
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

Time: 1.12 secs; Memory: 4Mb

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
No: Causes module duplication and/or fragmentation. Similar: https://www.drupal.org/project/views_results_inject
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
No: Does not follow the guidelines for in-project documentation and/or the README Template. See pareview
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
No: List of security issues identified: Sanitize data from $form_state['input']: https://www.drupal.org/writing-secure-code
Coding style & Drupal API usage
  1. (*) variable and function visibility: in views module visibility is updated. To not set visibility might be PHP compatible, but does not follow drupal coding standards: https://www.drupal.org/docs/develop/coding-standards/object-oriented-code
  2. (*) same for var keyword
  3. (*) if you use type hinting for one parameter/result, you have to list all parameter/result including variable type, or you delete all type hints
  4. I agree, to maintain API compability, lowerCamel format is not neccessary here
  5. (*) Provide complete HTML files in help directory, not just the BODY content

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.

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.

apaderno’s picture

Status: Needs work » Closed (won't fix)

If you are still working on this application, you should fix all known problems and set the status to Needs review. (See also the project application workflow.)
Please don't change status of this application if you aren't sure you have time to dedicate to this application, or it will be closed again as won't fix.

I am closing this application due to lack of activity.