Find PHP Code written in Views. This module will gone show you a table in which you will find name of view's and PHP code written in Global PHP Field. This module will Create views for it (link will be provided on the top of table. Using this view you can add additional functionality to this views).

Project Home Page: PHP Code In Views

Git clone command:

git clone --branch 7.x-1.x https://git.drupal.org/sandbox/Hardik_Patel_12/2792759.git php_code_in_views
cd php_code_in_views

Manual reviews of other projects:
1)https://www.drupal.org/node/2784545#comment-11702083
2)https://www.drupal.org/node/2633498#comment-11702249
3)https://www.drupal.org/node/2719763#comment-11701759

Comments

Hardik_Patel_12 created an issue. See original summary.

lionslair’s picture

Title: PHP Code In Views » [D7] PHP Code In Views
Issue summary: View changes

Fixed title and got clone command

lionslair’s picture

Status: Active » Needs work

Please review the results from the automated tests.
http://pareview.sh/pareview/httpsgitdrupalorgsandboxhardikpatel122792759git-7x-1x

  1. I suggest in your php_code_in_view.install file you add an hook_uninstall() to remove your custom table if the module is removed.
  2. You should remove the debug comments eg // dpm($view,"views");
  3. in your .info file I think views should be a dependencies. Does this module also require the php text format as well?
hardik_patel_12’s picture

Hi lionslair ,
Thanks for your suggetions . I have Covered all 3 points suggested by you.

lionslair’s picture

further comments

It is good you now have the uninstall hook. However there is a better way to remove the table than explitily drupal_uninstall_schema
https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_...

function php_code_in_view_uninstall() {
  // Delete the table.
  drupal_uninstall_schema('php_code_in_view');
}

I re-ran the automated tests and there are still a few issues I believe need addressing

http://pareview.sh/pareview/httpsgitdrupalorgsandboxhardikpatel122792759...

  1. You need to set your default branch.
  2. Prefix your custom function names your module name.
  3. pareview_temp/php_code_in_view.module:15 instead of

    'access callback' => TRUE,

    change to

    'access arguments' => array('access content'),

  4. 64 | WARNING | Unused variable $key.

    I don't think this is an issue but to clear the warning

    foreach ($php_arary as $value) {

    Should work the same way and clear the warning.

hardik_patel_12’s picture

Status: Needs work » Needs review
PA robot’s picture

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.

panshulk’s picture

Assigned: Unassigned » panshulk
panshulk’s picture

Assigned: panshulk » Unassigned

Hi @Hardik
All the issues mentioned by @lionslair are covered.

the only thing that is a bit confusing is the name of the variable $php_arary, is this out of purpose of there is a spell mistake ?

Also please look into the issues identified by PAREVIEW.

http://pareview.sh/pareview/httpsgitdrupalorgsandboxhardikpatel122792759...

Thanks :)

hardik_patel_12’s picture

hi @panshulk,
The name of the variable $php_arary is corrected now , ya it was just a spell mistake.

visabhishek’s picture

Status: Needs review » Needs work
Issue tags: -Needs Review +PAreview: security

Anyone with the "access content" permission can view php code used in views. I think its a security issue and not a realistic scenario, so you should use a proper permission for that.

/**
 * Implements hook_menu()
 */
function php_code_in_view_menu() {
  $items['find-php-in-views'] = array( 
    'page callback' => 'php_code_in_view_callback',
    'description' => 'Show a page with a long list of views which has php code',
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
  ); 
  return $items;
}
hardik_patel_12’s picture

Hi , @visabhishek
I have used proper pemissions now to see contents.
Thankyou.

hardik_patel_12’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus
hardik_patel_12’s picture

Status: Needs work » Needs review
ganesan g’s picture

Status: Needs review » Needs work

Automated Review

http://pareview.sh/pareview/httpsgitdrupalorgsandboxhardikpatel122792759...

Please fix the issues identified by PAREVIEW. It is important to solve since most errors related to coding standards.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
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. Please update "views" and "views_php" module under "Requirements" section since they are dependency.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes. Meets the security requirements.
Coding style & Drupal API usage
  1. (*) Please give access restriction for default view "Php code in views" to be accessible only for the user who has permission "Administrator php code in views" and also please add "views_php" as a dependency in .info file
  2. (+) Please follow multiline doc comment for function definitions and add @param and @return doc under each hooks. Please check Doxygen and comment formatting conventions for details.

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.

PA robot’s picture

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

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

ashishdalvi’s picture

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

Hi,

Automated test run have following issues.

ad line endings were found, always use unix style terminators. See https://www.drupal.org/coding-standards#indenting

./.gitignore: ASCII text, with no line terminators

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: /root/repos/pareviewsh/pareview_temp/php_code_in_view.module
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
219 | WARNING | Unused variable $translatables.
----------------------------------------------------------------------

klausi’s picture

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

Let's keep this closed until we hear back from @Hardik_Patel_12.

hardik_patel_12’s picture

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

Hi @Ashish
I have removed all errors and warning which were generated by Automated testing.

ashishdalvi’s picture

Assigned: Unassigned » ashishdalvi

Thank you. I will review it.

bramtenhove’s picture

Status: Needs review » Needs work

Hi @Hardik_Patel_12,

Nice idea for a module, can indeed by quite helpful during development.

Automated Review

No issues were found.

Manual Review

Individual user account
Follows the guidelines for individual user accounts.
No duplication
Does not cause module duplication and/or fragmentation.
Master Branch
Follows the guidelines for master branch.
Licensing
Follows the licensing requirements.
3rd party assets/code
Follows the guidelines for 3rd party assets/code.
README.txt/README.md

Follows the guidelines for in-project documentation and/or the README Template.

Improvements

  1. The heading of the installation section is currently -- INSTALLATION --, however it is preferred to underline the heading with dashes
  2. Minor indentation issues in the configuration section, e.g. line 42 and 43
Code long/complex enough for review
Follows the guidelines for project length and complexity.
Secure code
Meets the security requirements.
Coding style & Drupal API usage
  1. (+) IDE configuration is committed in the project, see folder nbproject
  2. Your database scheme is set to varchar with a length of 2000, if more than 2000 characters are saved you will get a fatal error
  3. Some output returned in php_code_in_view_callback() does not go through the t() function
  4. I think it would be nicer to have the overview page part of /admin/reports as this is more of a reporting tool
PA robot’s picture

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

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

avpaderno’s picture

Assigned: ashishdalvi » Unassigned
avpaderno’s picture

Status: Closed (won't fix) » Closed (duplicate)
Related issues: +#3103138: [D8] Disable Browser Back Button