Administration module where you can select content types (and their relatives tag fields) from where users have to inherit tags.

When a user open a page of that specific content type, all the tags will be applied to that specific user, so you can track interests of people visiting your web site.

The module create a user tag field and a vocabulary (if the standard "tags" one doesn't exist) by itself.

Link to sandbox project: http://drupal.org/sandbox/hiryu/1977374

Link to git repository: http://git.drupal.org/sandbox/hiryu/1977374.git

Comments

PA robot’s picture

Status: Needs review » Needs work

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

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and 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.

hiryu’s picture

I've done a bit of standardization for my code.

I don't know if the remaining errors are real errors or just false positive.

Any help would be appreciated.

hiryu’s picture

Status: Needs work » Needs review
hiryu’s picture

I've solved all errors and warning except this:

FILE: /var/www/drupal-7-pareview/pareview_temp/userautotag.module
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
1 | ERROR | End of line character is invalid; expected "\n" but found "\r\n"
258 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------

Can someone help me to understand how to solve it?

Thanks

hiryu’s picture

ok... last thing... what's this?

./userautotag.module: the byte order mark at the beginning of UTF-8 files is discouraged, you should remove it.

hardcoding’s picture

Hi hiryu,

here are some things i found:

code

userautotag.module:

ok... last thing... what's this?

./userautotag.module: the byte order mark at the beginning of UTF-8 files is discouraged, you should remove it.

Looks like your editor manually puts a bom to your file. Maybe you should take an other editor and create a new file.
- http://en.wikipedia.org/wiki/Byte_order_mark

There are some strings which are not translatable like messages to the user.

userautotag.css:

- remove line 11
-

}

in this line is unnecessary

in drupal

i get some warnings from your module:

Notice: Undefined variable: fields in userautotag_get_fields_list() (line 35 in ../sites/all/modules/user_auto_tag/userautotag.functions.php).

after saving in admin/config/workflow/userautotag:

Warning: Invalid argument supplied for foreach() in form_select_options() (line 2593 in ../includes/form.inc).

But your module works like written in the description.

hardcoding’s picture

Status: Needs review » Needs work
hiryu’s picture

Status: Needs work » Needs review

Hi hardcoding,

thanks for your precious help!

I've fixed what you've said, but I didn't get any PHP warning. Maybe they came from an unset variable, so I've added, in the relative function, a declaration of the variable $fields = FALSE.

Let me know if there is some other work to do.

hardcoding’s picture

Status: Needs review » Needs work

Hi hiryu,

i don't get an notice anymore that's ok, but i still get this warning after saving. i will install your module in a clean drupal installation. hope i will get no warning after that. :)

As i can see there are still some strings which are not translatable. Please check that.

  • Line 32
  • Line 68
  • Line 78
  • Line 128
  • Line 132
  • Line 147
  • Line 154

You are currently working in your master branch. Please create a "7.x-1.x" branch and push it to git. After that you can delete your master branch.

hiryu’s picture

Status: Needs work » Needs review

As i can see there are still some strings which are not translatable. Please check that.

You mean sting not wrapped in "t()" ? If yes, ok, I've fixed them wrapping every message in a t() function.

Regarding Git, I'm very new to it, I know just 3 commands:

git add -A
git commit -m "standardizing..." --author="hiryu <hiryu@2502794.no-reply.drupal.org>"
git push -u origin master

Can you tell me how to create a "7.x-1.x" branch and push my code into it?

Thanks a lot!

PA robot’s picture

Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: http://drupal.org/node/1978434

Project 2: http://drupal.org/node/1985214

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

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

hiryu’s picture

My "Webform Advanced Reports" module is not a duplicate of this project. I don't understand why it was closed.

PA robot’s picture

Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: http://drupal.org/node/1978434

Project 2: http://drupal.org/node/1985214

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

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

hardcoding’s picture

Status: Needs review » Needs work

Can you tell me how to create a "7.x-1.x" branch and push my code into it?

to push:
git push <remote-name> <branch-name>
to remove:
git push origin --delete <branch-name>
for more information see gitref.org

a.milkovsky’s picture

Manual review:
1) in Drupal is more common to use .inc files instead of .php files.

2) don't use $_POST global array in form submit. Use $form_state['values'] instead.
Here is part of your code:

if (!empty($_POST['userautotag_adm_exclude'])) {
    variable_set('userautotag_adm_exclude', $_POST['userautotag_adm_exclude']);
    $msg = t('Tagging for Administrators: Disabled');
  }

3)

Can you tell me how to create a "7.x-1.x" branch and push my code into it?

Also read this article http://drupal.org/node/1127732

hiryu’s picture

Status: Needs work » Needs review

Thank you for your help. I've created a branch 7.x-1.x and deleted the master.

What's the next step to apply for a full project??

a.milkovsky’s picture

read this article

Use Review bonus program

hardcoding’s picture

Have you already read this article?

hiryu’s picture

1) in Drupal is more common to use .inc files instead of .php files.

2) don't use $_POST global array in form submit. Use $form_state['values'] instead.
Here is part of your code:

Fixed!

Just one thing about review program... Is it mandatory to get a full project access?

samvel’s picture

Status: Needs review » Needs work

Hi, manually reviewed:

  • Please append link to git repository in current issue
  • You still use $_POST instead $form_state_values in submit handler(lines 135-146)
  • Error on line 45 and 50 in user_auto_tag.functions: if ($vocaboulary->machine_name == $form_stateDEFAULT_VOCABULARY) {
  • unused variable $key on line 31 and $nestedkey on line 125 in user_auto_tag.functions
samvel’s picture

Issue summary: View changes

Added link

hiryu’s picture

Status: Needs work » Needs review

Link appended in the issue and code fixed.

hiryu’s picture

How can I get the sign off for this module and apply for a full project?

gianfrasoft’s picture

This project is a great intuition. I'm going to use it now... Thank you.

gianfrasoft’s picture

Status: Needs review » Needs work

Please add some other description to readme file...

hiryu’s picture

Status: Needs work » Needs review

readme.txt and help.html updated with new and more complete informations.

gianfrasoft’s picture

Status: Needs review » Reviewed & tested by the community

Ok, thank you!

hiryu’s picture

Hi guys,

it's almost 2 weeks I've got no feedback on this project. Can someone advise me on how to move on to apply for a full project?

I've read this: https://drupal.org/node/1068952 but on my sandbox project page there is no link to apply.

What's the next step?

Thank you very much.

thedavidmeister’s picture

Status: Reviewed & tested by the community » Needs work

Just some minor comments.

I don't think you should be using !important in css for contrib code.

// field_delete_field('field_user_auto_tags');

There's no reason to keep debug code lying around.

* Implements of hook_install().

"Implements hook_install()." not "Implements of hook_install().". Similar issue for most of the other documented hooks.

Avoid using module_load_include() in the global context, see the docs at https://api.drupal.org/api/drupal/includes%21module.inc/function/module_...

$user->field_user_auto_tags[LANGUAGE_NONE][]['tid'] = $applytag;

There are a few places where you're using LANGUAGE_NONE instead of the field API. This would make your module incompatible with internationalization/translation.

I'm wondering if it might be more efficient to convert your various, dynamic variable_set() calls (that use $type) that could end up representing many individual variables into a single array variable, unless there's a strong use-case for keeping them separate.

$path = realpath(dirname(__FILE__));

Can we not use drupal_get_path() here?

  // Adding CSS and JS just in the admin section.
  if (arg(0) == 'admin') {
    drupal_add_css(drupal_get_path('module', 'user_auto_tag') . '/user_auto_tag.css', array('group' => CSS_DEFAULT, 'every_page' => TRUE));
  }

Why are we not using path_is_admin() https://api.drupal.org/api/drupal/includes%21path.inc/function/path_is_a... ?

Why are we adding css to every admin path?

hiryu’s picture

Status: Needs work » Needs review

Hi, and tahnks for your help.

// field_delete_field('field_user_auto_tags');
Deleted.

* Implements of hook_install().
Changed in (all of them):
* Implements hook_install().

Avoid using module_load_include() in the global context, see the docs at

Moved into "hook_init()".

$user->field_user_auto_tags[LANGUAGE_NONE][]['tid'] = $applytag;
Replaced LANGUAGE_NONE with $langcode.

$path = realpath(dirname(__FILE__));
Replaced with:
$path = drupal_get_path('module', USER_AUTO_TAG_PATH_NAME);

Can we not use drupal_get_path() here?

Yes we can! I've changed it as you've suggested, but how can I load my css just in my module pages instead of all Admin section pages?

mavin’s picture

Status: Needs review » Needs work

Hi,

It looks like you're calling an undefined function in user_auto_tag_install() (line 22 in user_auto_tag.install)
-> function user_auto_tag_check_vocaboulary()

hiryu’s picture

Status: Needs work » Needs review

Fixed! Thank for the bug notice, was a misconfigured file name for the include.

vincenzo gambino’s picture

If you don't mind about translation you may ignore the error below.


FILE: /var/www/drupal-7-pareview/pareview_temp/user_auto_tag.module
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 184 | WARNING | Only string literals should be passed to t() where possible
--------------------------------------------------------------------------------
hiryu’s picture

Changed t() with check_plain().

kscheirer’s picture

Status: Needs review » Reviewed & tested by the community

<hr> tags should technically be <hr/>.

I'm not sure why you're using check_plain() instead of t()? check_plain() just sanitizes the string - t() allows it to be translated. The comment in #32 just meant that when possible you should use t() like t('String you can translate"). When you do t($variable_to_translate) it doesn't allow a code parser to pre-determine all the translatable strings in your code. Not a major issue, and changing all the check_plains to t() is not the answer.

typo "variablke" should be "variable".

It would be nice to include a way to configure this module on a per-role basis. Currently it will either affect all users or all non-admins.

----
Top Shelf Modules - Enterprise modules from the community for the community.

hiryu’s picture

Hi,

thanks for the tip, having a role based system is not a bad idea, I can add it in a nearly future release.

Do you think I can use my text strings without any wrapping function like t() or check_plain()?

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

Definitely use something, I think using t() is better, but I guess check_plain() is ok too.

Thanks for your contribution, hiryu!

I updated your account to let you 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 get 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.

----
Top Shelf Modules - Crafted, Curated, Contributed.

hiryu’s picture

Thanks a lot for your support!!

avpaderno’s picture

Issue summary: View changes
Status: Closed (duplicate) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.