Dear all,

I have written a module to provide an extra bit of Views (3.x) functionality for Drupal 7.

In some cases (a fair bit I must say) it desired, when a View produces only a single result, to skip the actual view (result listing) and go to the desired content directly. Up until now, many folks accomplish this via some PHP code in the header/footer of the display. Yet, I feel this functionality belongs in a module, both for configurability as for "cleanliness".

By providing an extra setting in the "Advanced" section under the "Others" heading, the user is able to setup a redirection path for when a View produces a single result. This path is, of course, tokenizable with the results of that one and only returned row.

Currently it is a personal itch scratcher, yet I tried to make this initial version as generic as possible.

All code in the module is fully linted and Drupal module development best practices adhered as much as possible.

The project sandbox: https://www.drupal.org/sandbox/timusan/2422313

The project GIT checkout: git clone --branch 7.x-1.x git.drupal.org:sandbox/Timusan/2422313.git views_fast_forward
The PAReview result: http://pareview.sh/pareview/httpgitdrupalorgsandboxTimusan2422313git

Manual reviews of other projects:

  1. https://www.drupal.org/node/2426697#comment-9627155
  2. https://www.drupal.org/node/2426991#comment-9627113
  3. https://www.drupal.org/node/2423505#comment-9627163
  4. https://www.drupal.org/node/2427623#comment-9630577
  5. https://www.drupal.org/node/2427287#comment-9631353
  6. https://www.drupal.org/node/2347459#comment-9634547

Cheers,
Tim

Comments

Timusan’s picture

Issue summary: View changes
Timusan’s picture

Issue summary: View changes
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://pareview.sh/pareview/httpgitdrupalorgsandboxTimusan2422313git

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.

Timusan’s picture

Status: Needs work » Needs review

Strange, these issues where not pointed out by using the recommended Coder (Review) module. Yet, most of them are fixed now and changes are pushed.

The Pareview checker now still complains about the casing of class and method names, yet CamelCasing Views class names and lowerCasing method names (as it suggests) breaks Views, so my bet is that these errors can be ignored?

If I am missing something...let me know!

sajiniantony’s picture

Use st() instead of t() in line number 14 of views_fast_forward.install, since the primary exception is that st() should generally be used to translate strings instead of the usual t() because the localization hasn't been set up until the installation process completes.

sajiniantony’s picture

Status: Needs review » Needs work
Timusan’s picture

Status: Needs work » Needs review

Thanks for pointing that out and for the explanation Sajiniantony.
I adjusted the code and pushed the changes.

yuriy.kostin’s picture

Status: Needs review » Needs work

Hi Timusan,

Automated Review
⊠ Somthing wrong with reviev: "Git clone failed. Aborting."

Individual user account
☑ Follows the guidelines for individual user accounts.

No duplication
☑ Does not cause module duplication.

Master Branch
✎ Not working automated review. I can not determine default branch.

README.txt/README.md
✎ It suffices to use one file of README.

Installation / Usage
⊠ The module description in the info is rather long. Please insert it in hook_help()
⊠ In .module file on lines 62 and 67 better used drupal_get_path() instead of dirname()

Project Description
You should provide the pareview link in the issue page to make the review process easier.
in this case: http://git.drupal.org/sandbox/timusan/2422313.git

naveenvalecha’s picture

Status: Needs work » Needs review

The wrong git command and hook_help additions are surely not application blockers, anything else that you found or should this be RTBC instead?

Timusan’s picture

Hi Yuriy

Thank you for the review!

1. The problem with Pareview is that you used an incorrect link to the git repo. "timusan" should be "Timusan", with a capital T. The Drupal code hosting is case sensitive. The correct link is as posted in my issue description:

http://git.drupal.org/sandbox/Timusan/2422313.git

However, Pareview seems to ignore this fact and lower-case the URL when trying to hotlink to the rendered review it produces. This seems to be a bug in Pareview itself. You will thus have to manually copy and past the given git repo link into the Pareview homepage for it to work.

The default branch is 7.x-1.x as stated on the sandbox version control tab.

2. Which README format is preferred? Mardown or plain text?

3. I rather shorten the description for this information is already provided via hook_help(). Yet, I see many modules with even longer descriptions. Do you consider this a possible stopper?

4. The hook_help() code is directly derived from the recommended code on drupal.org itself: https://www.drupal.org/node/161085#hook_help . This documentation should be considered wrong?

Timusan’s picture

In the meantime, contrary to sajiniantony's comments on using st() instead of t() during installation, I reverted back to use only get_t() inside the hook_install() instead, as pointed out by the automated testing system / documentation. This change is now committed and pushed.

Timusan’s picture

Issue summary: View changes
naveenvalecha’s picture

I would recommend you, please help to review other project applications to get a review bonus back. This will put you on the high priority list, then git administrators will take a look at your project right away :)

Timusan’s picture

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

@naveenvalecha: Done!

Timusan’s picture

Issue summary: View changes
naveenvalecha’s picture

klausi’s picture

Issue summary: View changes
klausi’s picture

Assigned: Unassigned » er.pushpinderrana
Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

Thank you for reviews. Next time please review applications in the "needs review" state because "needs work" applications are blocking on an applicant response anyway.

manual review:

  1. you should only have one README file: either delete README.txt or README.md.
  2. "define('VIEWS_FAST_FORWARD_PATH', drupal_get_path('module', 'views_fast_forward'));": that path lookup will run on every single page request even if your module is not involved at all - is this really necessary just fro the Views API hook?
  3. options_definition_alter(): is this method really needed? Does the same as options_definition(), why? Please add a comment or remove.
  4. Ah, the module only works if I use a View that uses the fields style? Please add that to the README.

But otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

Assigning to er.pushpinderrana as he might have time to take a final look at this.

Timusan’s picture

Thank you, Klausi, for the detailed review and for your note on reviewing "needs review" statuses only (apologies for that).

Regarding your manual review notes:

1. you should only have one README file: either delete README.txt or README.md.

I still had this pending on which was the best format, I have now opted for the most "rich" one and removed the plain text version.

2. "define('VIEWS_FAST_FORWARD_PATH', drupal_get_path('module', 'views_fast_forward'));": that path lookup will run on every single page request even if your module is not involved at all - is this really necessary just fro the Views API hook?

I had done this for better readability throughout the code, yet this is indeed a case where performance outweighs readability, I have removed this constant and inlined it instead.

3. options_definition_alter(): is this method really needed? Does the same as options_definition(), why? Please add a comment or remove.

option_definition_alter() seems to be quite redundant indeed. I removed it in favor of the standard option_definition() method.

4. Ah, the module only works if I use a View that uses the fields style? Please add that to the README.

Correct, for now I have opted to support only "fields" style Views. This indeed had to be clearly mentioned on the sandbox page and in the README. Sorry for that, it has now been added to both.

All the changes have been committed in separate, descriptive commits and pushed onto the 7.x-1.x branch.

I will review three new projects as soon as possible.

Cheers,
Tim

Timusan’s picture

Issue summary: View changes
Timusan’s picture

Issue summary: View changes
Timusan’s picture

Issue summary: View changes
Timusan’s picture

Issue tags: +PAreview: review bonus

I reviewed three other modules which had status "Needs review" (and some I changed to "Needs work" after I reviewed). The new reviews are number 4, 5 and 6 in the issue description.

Cheers,
Tim

klausi’s picture

Assigned: er.pushpinderrana » Unassigned
Status: Reviewed & tested by the community » Fixed

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

Thanks for your contribution, Timusan!

I updated your account so you can 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 stay 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.

Timusan’s picture

Hi Klausi

Thank you too for your review time on this project and for upgrading my account.
I will take the time to read through the recommended texts and try to hangout on IRC more often.

Thanks to all other review folks as well, I appreciate you taking time to review my code.

Cheers,
Tim

Status: Fixed » Closed (fixed)

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