This module provides a block to be used to collect feedback on page's content from the site visitor. It will store the feedback with respective page link, which can be exported into CSV file on demand.

Key Features:

  • A feedback collection block. Can be assigned at any theme region
  • Dynamic option adding for remarks on negative feedback
  • Ajax based feedback Submission
  • Export on demand
  • Clear record on demand

Haven't able to find any similar module like this

Project page:

https://drupal.org/sandbox/sheikh303/2277585
GIT Clone:http://git.drupal.org/sandbox/sheikh303/2277585.git

P.S. :
1. This is my first module submission
2. Haven't reviews any modules/themes yet.

Comments

sheikh303’s picture

Issue summary: View changes
harshil.maradiya’s picture

Hi ,

I am not able to clone your code its asking for password
"git clone --branch 7.x-1.0 sheikh303@git.drupal.org:sandbox/sheikh303/2277585.git"
Actually you have add wrong git url

git clone url should like this
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/harshil.maradiya/2209623.git

so your actual url is
git clone --branch 7.x-1.0 http://git.drupal.org/sandbox/sheikh303/2277585.git

Please update your page

Cheers

harshil.maradiya’s picture

Please fix all par review comment

You can check ur code for par review on following url
http://pareview.sh/
Add your git url in text field

harshil.maradiya’s picture

I did quick review and found following comments

  1. No need to add module file in file array drupal automatic load all .module files in .info fire.
  2. Commenting on methods are not match with drupal standards(Please go through with par review report)
  3. All variables should delete on un install of this module on all db drivers.
  4. Remove commented code and test function from .admin.inc.
  5. Please put your database interaction(insert,update,delete) code in try catch block .
  6. Use drupal_exit rather than use exit.
harshil.maradiya’s picture

Status: Needs review » Needs work
sheikh303’s picture

Issue summary: View changes
sheikh303’s picture

Hi Harshil,
Thanks a lot for pointing out the issues. will fix and update ASAP.
GIT clone url is updated.

cheers,

sergeypavlenko’s picture

abogomolov’s picture

StatusFileSize
new356.56 KB

Hi sheikh303,

After installation I get a PHP warning on the configuration page.
Warning: Invalid argument supplied for foreach() in page_feedback_admin_settings() (line 122 of /home/www/open-source/drupal/httpdocs/sites/all/modules/review/page_feedback/page_feedback.admin.inc).
You should check the type of the variable first.

The Coder module found some issues. (See attachment page-feedback-coder.png)

MENU_NORMAL_ITEM is the default value. So defining a type in hook_menu is not necessary. (backlinkseller.module:47)
'type'=> MENU_NORMAL_ITEM,

Never reformat data when storing it. This should happen at page render time. You also have 2 semicolons in this line. (backlinkseller.module:95)
$data['feedback_remarks'] = check_markup( filter_xss( $feedback_data['remark'])); ;

Do not use nativ MySQL. Use always the database abstraction layer. Use hook_schema()

db_query("CREATE TABLE IF NOT EXISTS `page_feedback` (
                `page_feedback_id` int(11) NOT NULL AUTO_INCREMENT,
                `page_uri` varchar(200) DEFAULT NULL,
                `feedback_val` tinyint(1) DEFAULT NULL,
                `feedback_remarks` varchar(1000) DEFAULT NULL,
                `submitted` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
                PRIMARY KEY (`page_feedback_id`)
            ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;");

Make all messages translateable. See page_feedback.admin.inc:92
drupal_set_message("Cleared page feedack data.");

Use the Devel module for debugging. (See page_feedback.admin.inc:170)

function pp($array = array()){
    echo "<pre>";
    print_r($array);
    echo "</pre>";
    
}

You should also use the FormAPI for the block content. (See page-feedback-block.tpl.php)

Romove console.log from JS. And use Drupal behaviors. Managing JavaScript in Drupal 7

sheikh303’s picture

Hi All,
Can anyone help me on the remaining coding standard issues. can be found at
http://pareview.sh/pareview/httpgitdrupalorgsandboxsheikh3032277585git

@abogomolov:
Thanks for the feedback. I tried to use drupal's schema. but it doesn't allow "timestamp" and current time timestamp as default value.
that's why i had to use native mysql.
Is there any way to get that using drupal's schema?

cheers

sheikh303’s picture

Hi All,
Most of the coding standard and security issues are resolved. I have been working on remaining 3 security issues, but couldn't find any way out. Any pointers will be highly appreciated.

I was wondering, should I open a new issue to get approval or this issue will do when the module is good to go?

harshil.maradiya’s picture

Would you please elaborate those three issues.
No need to create new issue, if we are working on regular basis then it fine.

sheikh303’s picture

Hi Harshil,
Having the follow issues:
"Input to check_plain is unsanitized from variable_get" at
$existing_options = unserialize(check_markup(filter_xss_admin(check_plain(variable_get('page_feedback_options')))));

FILE: /var/www/drupal-7-pareview/pareview_temp/page_feedback.admin.inc
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
140 | ERROR | Input to check_plain is unsanitized from variable_get
--------------------------------------------------------------------------------

FILE: /var/www/drupal-7-pareview/pareview_temp/page_feedback.module
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
148 | ERROR | Input to unserialize is unsanitized from variable_get

sheikh303’s picture

Hi All,
Updated the module, implementing Drupal behaviors.

sheikh303’s picture

Status: Needs work » Needs review
harshil.maradiya’s picture

Hello Sheikh,

You can use check_plain or filter_access methods to sensitize the in put data .
On both the line you can use these function let me know if you need more help

http://api.drupalhelp.net/api/drupal/includes--bootstrap.inc/function/ch...

https://api.drupal.org/api/drupal/modules%21filter%21filter.module/funct...

Cheers,
Harshil Maradiya

sheikh303’s picture

Hi Harshil,
no luck. I already used check_plain and filter_xss while unserializing data from variable_get.

$existing_options = unserialize(check_plain(variable_get('page_feedback_options', "")));

yet getting this security error:
ERROR | Input to check_plain is unsanitized from variable_get
Not sure, if its a common issue of the security checking script.

sheikh303’s picture

Hi All,
Expecting a review and/or acceptance on the module. Thanks in advance.

jschoen1’s picture

Hi,

In trying to check out your code I ran into a bit of confusion - you have 2 branches, but your git clone link doesn't point to the branch that pareview wants to check.

I ran pareview on both branches, and both have issues (though, the dev branch has a TON, and the 7.x-1.x branch only has 2: the check_plain/unserialized unsanitized input errors).

which branch is correct? please update your git clone link by appending --branch before the uri to your repository.

I'm not sure if this will work, but try assigning the value of variable_get('blahblah') to a variable, then passing the variable to check_plain() and see if that gets rid of those errors.

jschoen1’s picture

Status: Needs review » Needs work
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