In the README and in the module's help, it uses $entity->field_product_price[LANGUAGE_NONE][0]['value'], when it should be using field_get_items().

This would also clear up issues like #1022192: Undefined offset: 0 when using $entity->field_name[0]['value'].

Comments

colan’s picture

Adding tag.

colan’s picture

Status: Active » Fixed

The web documentation has been updated. The README was removed in c3876eb.

tim.plunkett’s picture

Status: Fixed » Active

Removing the README is a terrible way to "fix" this problem. READMEs are very important to have.

colan’s picture

Status: Active » Fixed

Not if it's redundant information that already exists in the documentation on the web. Click on the documentation link from the main project page to find everything. There's really no point duplicating data everywhere; it's better to have one authoritative source.

You'll note that field_get_items() is used in the documentation over at http://drupal.org/node/126522.

tim.plunkett’s picture

Status: Fixed » Active

Under the "minimum requirements" for maintaining the documentation of a module:

All modules should provide a README.txt file. This plain-text file should contain a basic overview of what the module does and how someone may use it. It should provide enough information for the user to evaluate whether it will suit their needs before they download and install the module.

  • The README.txt file should repeat the synopsis on the project page on Drupal.org.
  • The project page on Drupal.org should contain a direct link to the README.txt.
  • Like all other module files, README.txt and other *.txt files, should use unix-style line-endings (\n), and not windows (\r\n) or mac (\r) line endings.
  • The file should be formatted to hard-wrap at 80 characters with unix-style line-endings.
colan’s picture

As I didn't see any justification for this, I started a more general discussion over at https://drupal.org/node/955134#comment-5552154. Please stand by.

Cablestein’s picture

I am tending to not agree with that notion.

I always make use of both readme's and web doc's depending on situation & convenience. Sometimes the readme is right under my cursor so I open it and/or I quickly scan the file preview of Explorer without having to open the file. Sometimes I'm on the website already and it's more convenient to click "Documentation" rather than trying to navigate to the module folder. If it means duplication and a bit more clutter, I don't care because I think for a very long time I will still work this way.

Also sometimes a website or module or whatever may be DOWN or edited or changed in some fashion after the fact. I don't want to have to worry about that and feel safe knowing some information is local and unchanging.

One more thing, personally I do not have an internet connection at home (going on 4 years now), but the odd time I bring module zip's on a USB onto my laptop for local server work. Readme files are very handy in that situation =P.

For whatever reason, readme's are usually clearer =P.

  • colan committed c7b0bc8 on 8.x-1.x
    Issue #1151582 by colan: In-line example now properly uses...
  • colan committed c3876eb on 8.x-1.x
    Issues #1151582 and #1354176 by colan: Moved README details to the web...

  • colan committed c7b0bc8 on 8.x-2.x
    Issue #1151582 by colan: In-line example now properly uses...
  • colan committed c3876eb on 8.x-2.x
    Issues #1151582 and #1354176 by colan: Moved README details to the web...