Metis automates the inclusion of the so called "Metis pixel" from the German association VG Wort. The pixel is included as an image that is 1px wide and high and it allows VG Wort to count visits to nodes. Based on that count, VG Wort pays authors (small) royalties obtained through the sale of printers, copiers, and other technical devices that might be used to copy texts.

Metis stands for "Reporting System for Texts on Websites" (Meldesystem für Texte auf Internetseiten).

More information about VG Wort and Metis (in German):

Module features:

  • Add Metis codes (Zählmarken) to your Drupal installation
  • Add the Metis codes to nodes as a CCK field with a simple checkbox
  • Display a table of nodes with their respective Metis codes (only if Views module is installed)

Drupal version:

The module is written for Drupal 6. As soon as there is a stable release, I would like to create a version for Drupal 7.

Similar projects:

So far, there are no similar modules. There is another sandbox project for Drupal 7 that still needs work. My module is for Drupal 6 so far. I have contacted the maintainer to see if we can join forces. But the approaches are quite different.

Project page:

The project page can be found here: https://drupal.org/sandbox/yan/1357886
The git repository: git clone http://git.drupal.org/sandbox/yan/1357886.git metis

Reviews:

https://drupal.org/node/1820564#comment-6724164
https://drupal.org/node/1884178#comment-7026226
So far just two. My skills are limited and so is my time, but I'll try to review more.

CommentFileSizeAuthor
#1 Screen Shot 2012-11-15 at 12.15.38.png26.43 KBwuh

Comments

wuh’s picture

Status: Needs review » Needs work
StatusFileSize
new26.43 KB

Nothing is flagged by the coder module, everything looks good on that front.

I have found some more general problems though:

In file metis.install:

  • There is a double line break at line 7
  • Line 20 results in escaped HTML, there are a few things wrong here. It should be something like this drupal_set_message($t('Metis settings are available under <a href="@link">Administer > Site configuration > Metis</a>', array('@link' => url('admin/settings/metis/settings')))); See the t() function page
  • Your database schema doesn't specify a primary key, perhaps intentionally

In file metis.module:

  • The top level menu item for your modules settings page has a menu type of MENU_LOCAL_TASK, this should be MENU_NORMAL_ITEM so that it appears in the main navigation menu tree and is editable (and movable) by administrators. It will also fix the styling issue you have with subsequent tabs.

In Use

I wasn't able to test this properly in use, but another issue which leapt out at me is that the Metis CCK field, when displayed on node edit pages, is not wrapped in a fieldset. Screenshot attached.

Most of the code looks sound, but I haven't been able to verify that it does what's advertised. Perhaps someone who's familiar with "Metis pixel" and "VG Wort" might be better placed to do so.

Looks good on the whole yan, but I'd advise reading thoroughly the Drupal documentation on coding standards.

vineet.osscube’s picture

There is still some minute errors in metis.module file.

398 | ERROR | Data type of return value is missing
489 | ERROR | Data type of return value is missing
500 | ERROR | Line indented incorrectly; expected 6 spaces, found 10

yan’s picture

Status: Needs work » Needs review

Thanks for your feedback.

There is a double line break at line 7

Line 20 results in escaped HTML, there are a few things wrong here. It should be something like this drupal_set_message($t('Metis settings are available under <a href="@link">Administer > Site configuration > Metis</a>', array('@link' => url('admin/settings/metis/settings')))); See the t() function page

I corrected those two. I thought I had copied the second one from some Drupal documentation page, but maybe not.

Your database schema doesn't specify a primary key, perhaps intentionally

No, not really intentionally. It's more, because I don't know database structures very well. Should I use a primary key?

The top level menu item for your modules settings page has a menu type of MENU_LOCAL_TASK, this should be MENU_NORMAL_ITEM so that it appears in the main navigation menu tree and is editable (and movable) by administrators. It will also fix the styling issue you have with subsequent tabs.

Thank you very much, that also fixed the problem I had with sub tabs!

I wasn't able to test this properly in use, but another issue which leapt out at me is that the Metis CCK field, when displayed on node edit pages, is not wrapped in a fieldset. Screenshot attached.

I changed that, too.

There is still some minute errors in metis.module file.

398 | ERROR | Data type of return value is missing
489 | ERROR | Data type of return value is missing
500 | ERROR | Line indented incorrectly; expected 6 spaces, found 10

I corrected those, too. See the report at http://ventral.org/pareview/httpgitdrupalorgsandboxyan1357886git

There are also two issues I haven't been able to resolve, maybe somebody can help:

maxgor’s picture

Title: Metis » to do right code
Priority: Normal » Minor

the image could be shown using theme_image function:
metis.module, line 1034: use this function: theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) to show the image

yan’s picture

Title: to do right code » Metis
Priority: Minor » Normal

I'll check taht. But please don't change the title. :)

maxgor’s picture

sorry for the title.

yan’s picture

I commited what is mentioned in #4:
http://drupalcode.org/sandbox/yan/1357886.git/commit/8e73208
Although I'm not sure if it was better to use theme('image', $vars) instead.

I also corrected a permission issue with the CCK field:
http://drupalcode.org/sandbox/yan/1357886.git/commit/d868dcc

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Sorry for the delay. Make sure to review more project applications to complete the review bonus and this will get finished faster.

manual review:

  1. project page is too short, see http://drupal.org/node/997024
  2. metis_codes_csv_form_validate(): why do you use check_plain() here? You are not printing anything to the user, so it is not neccessary? Please read http://drupal.org/node/28984 again.
  3. "t('Private metis code') . ': ' . $defaults['code_private']": do not concatenate variables into translatable strings, use placeholders with t() instead.
  4. "theme_image($path, NULL, NULL, $attributes, FALSE);": do not call theme_image() directly, use theme('image', ...) instead.

But that are not application blockers, so I guess this is RTBC.

yan’s picture

Thanks for the review, klausi.

Make sure to review more project applications to complete the review bonus and this will get finished faster.

I know. The problem is, that many modules are too complex for me to review them.

project page is too short, see http://drupal.org/node/997024

I fixed that: https://drupal.org/sandbox/yan/1357886

metis_codes_csv_form_validate(): why do you use check_plain() here? You are not printing anything to the user, so it is not neccessary? Please read http://drupal.org/node/28984 again.

Ok, I thought it was necessary because the input comes from the user. But I fixed that.

"t('Private metis code') . ': ' . $defaults['code_private']": do not concatenate variables into translatable strings, use placeholders with t() instead.

I thought it was better that way because "Private metis code" is used several times and that way there is need for one single translation. But if that's bad practice, I'll change it.

"theme_image($path, NULL, NULL, $attributes, FALSE);": do not call theme_image() directly, use theme('image', ...) instead.

I changed that.

It can all be seen here: http://drupalcode.org/sandbox/yan/1357886.git/commitdiff/40daa7b

yan’s picture

Will I have to do anything else to have my sandbox converted to a full project? Or just wait?

klausi’s picture

Status: Reviewed & tested by the community » Fixed

no objections for more than a week, so ...

Thanks for your contribution, yan!

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.

yan’s picture

Thank you very much, Klausi and all the reviewers!

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Added a link to a review