This is a simple module adds a link to a Read more the details in the teaser ajax. This will in effect create a blog like on facebook (no need to go back to the blog)

This module is designed for personal needs, and has two objectives: to make life easier for developers who collect site without delving into writing code, and the second to show by example the possibility ajax in Drupal.
This module is compatible views,views_load_more.

https://www.drupal.org/sandbox/artmix/2366527

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/artmix/2366527.git read_more_ajax

Pareview:

http://pareview.sh/pareview/httpgitdrupalorgsandboxartmix2366527git

here a demo click on the Read more
http://d7.vdrupale.com/

Reviews of other projects:
https://www.drupal.org/node/2326223#comment-9553307
https://www.drupal.org/node/2411721#comment-9552927
https://www.drupal.org/node/2358759#comment-9553341

Files: 
CommentFileSizeAuthor
#17 link_more_ajax.patch3.57 KBKartagis

Comments

xdevx’s picture

Issue summary: View changes
xdevx’s picture

Issue summary: View changes
PA robot’s picture

Status: Active » Needs work

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

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.

xandeadx’s picture

1. "name" in .info must begin with a capital letter
2. "version" in .info need not
3. Classes in more_ajax.js must be a dash instead underlining
4. $items['more/node/%'] -> $items['more/node/%node']
5. 'access callback' => 'access content' -> 'access callback' => 'node_access'
6. In _more_ajax_content() use underlining instead of camelCase notation

xdevx’s picture

Issue summary: View changes
Priority: Normal » Critical
Status: Needs work » Active
xdevx’s picture

Issue summary: View changes
xdevx’s picture

Status: Active » Needs review
xdevx’s picture

Issue summary: View changes
xdevx’s picture

Priority: Critical » Normal
naveenvalecha’s picture

Issue summary: View changes

Updated git clone url and added pareview.

xdevx’s picture

here a demo click on the Read more
http://d7.vdrupale.com/

xdevx’s picture

Issue summary: View changes
rootwork’s picture

I think more explanation and screenshots would help make this project clearer. Something like: "Turn the 'Read more' link into an Ajax link that loads the rest of the body of a node inline."

Also it would be helpful to note whether this loads the full node (with things like node links and comments) or just the rest of that body field.

The demo is definitely helpful though.

vanyamtv’s picture

Status: Needs review » Needs work

Well, first of all, you've stated the "package = Core" in your info file, just remove it.

xdevx’s picture

Status: Needs work » Needs review
yuriy.kostin’s picture

Status: Needs review » Needs work

Hi artmix. Something wrong with your README file. In repository of project this file exist but PReview was find a mistake: http://prntscr.com/5v6yed Read details https://www.drupal.org/node/1587704 [5.2 Ensure the repository contains a detailed README.txt.]

Kartagis’s picture

FileSize
3.57 KB

Also, there is a link_more_ajax directory inside the project directory when we clone the project. This is wrong, unless you plan to introduce more modules in the project. Attached is a patch.

xdevx’s picture

Status: Needs work » Reviewed & tested by the community
xdevx’s picture

Status: Reviewed & tested by the community » Needs review
joachim’s picture

Status: Needs review » Needs work
Issue tags: -content, -Ajax, -easy

Good idea, and works very nicely!

A few glitches though:

First off, this module appears to be in a subfolder in the git folder. That's not right...

> description = Adds a link to a more ajax

This doesn't quite make sense.

Your functions are missing documentation of their @params and @returns.

(BTW, Please don't use tags for adding random keywords or duplicating any other fields.)

xdevx’s picture

I modified the module and considered all comments

xdevx’s picture

Status: Needs work » Needs review
xdevx’s picture

Title: [D7] Link more ajax » [D7] Read more ajax
xdevx’s picture

Issue summary: View changes
xdevx’s picture

Issue summary: View changes
xdevx’s picture

Issue summary: View changes
xdevx’s picture

Issue tags: +Ajax, +teaser, +content
xdevx’s picture

xdevx’s picture

Issue summary: View changes
xdevx’s picture

Issue summary: View changes
mpdonadio’s picture

Assigned: xdevx » mpdonadio

This will be my next review, which will either be tonight or tomorrow.

mpdonadio’s picture

Assigned: mpdonadio » Unassigned
Status: Needs review » Needs work
Issue tags: +PAReview: security

Automated Review

Review of the 7.x-1.x branch (commit 3460ae4):

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.


FILE: /home/matt/PAR/coder/pareview_temp/README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 4 | WARNING | Line exceeds 80 characters; contains 82 characters
----------------------------------------------------------------------


FILE: /home/matt/PAR/coder/pareview_temp/read_more_ajax.module
----------------------------------------------------------------------
FOUND 19 ERRORS AND 2 WARNINGS AFFECTING 12 LINES
----------------------------------------------------------------------
  9 | ERROR   | [x] Whitespace found at end of line
 10 | WARNING | [ ] Hook implementations should not duplicate @return
    |         |     documentation
 10 | ERROR   | [ ] @return data type must not contain "$"
 27 | ERROR   | [x] Whitespace found at end of line
 28 | WARNING | [ ] Hook implementations should not duplicate @param
    |         |     documentation
 28 | ERROR   | [ ] Missing parameter type
 28 | ERROR   | [x] Tag value indented incorrectly; expected 1 space
    |         |     but found 2
 43 | ERROR   | [x] Whitespace found at end of line
 44 | ERROR   | [ ] Missing parameter type
 44 | ERROR   | [x] Tag value indented incorrectly; expected 1 space
    |         |     but found 2
 46 | ERROR   | [ ] Separate the @param and @return sections by a
    |         |     blank line.
 46 | ERROR   | [ ] Return comment must be on the next line
 58 | ERROR   | [x] Whitespace found at end of line
 59 | ERROR   | [ ] Missing parameter type
 59 | ERROR   | [x] Tag value indented incorrectly; expected 1 space
    |         |     but found 2
 59 | ERROR   | [x] Whitespace found at end of line
 61 | ERROR   | [ ] Separate the @param and @return sections by a
    |         |     blank line.
 61 | ERROR   | [ ] @return data type must not contain "$"
 61 | ERROR   | [x] Whitespace found at end of line
 73 | ERROR   | [x] Whitespace found at end of line
 74 | ERROR   | [ ] Return comment must be on the next line
----------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

None of these are major or blcokers. Just fix when you can.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party code
Yes: Follows the guidelines for 3rd party code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Maybe: Follows the guidelines for project length and complexity. This falls under the lines of code recommendation, and has four functions plus a behavior. I want a second opinion from another mod, but I think I may let this on through since it demonstrates several aspects of the Drupal API.
Secure code

(*) No, you have a node access problem. If a node is unpublished or unaccessible, it is still possible get it via the AJAX menu.

read_more_ajax_menu() should look more like

  $items['more/node/%'] = array(
    'title' => 'More node content',
    'page callback' => 'read_more_ajax_callback',
    'page arguments' => array(2),
    'delivery callback' => 'ajax_deliver',
    'access callback' => 'node_access',
    'access arguments' => array('view', 2),
  );
  

This will make sure the user has access to the full node. Then, since this is using a loader placeholder (see hook_menu()), you change

  function read_more_ajax_callback($node, $mode = NULL) {
  }
  

and then make the appropriate logic adjustments.

To test this, make an unpublished node, and then manually browse to more/node/1234 (or whatever the nid is for the unpublished node), and make sure you don't get back the node in the AJAX.

Coding style & Drupal API usage

(+) In read_more_ajax_node_view_alter(), using #attached is preferred over drupal_add_js() and drupal_add_library().

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

xdevx’s picture

I fixed a bug with the safety standards take into account all the coding and even added the admin interface to include different types of nodes

xdevx’s picture

Status: Needs work » Needs review
naveenvalecha’s picture

Status: Needs review » Reviewed & tested by the community

Congrats artmix!, Thanks for the contribution!
Manual Review :

  1. Add the module configuration link in the .info file so that it will display on the module listing page.See https://www.drupal.org/node/542202
  2. (+) Remove the used variables from the module using the hook_uninstall by implementing it in the modulename.install file.
  3. menu path "admin/config/content/ajax_readmore" is using "administer site configuration" permissions.For long term I would suggest you to define your own permission provided by the module.
  4. read_more_ajax_node_type_active : After viewing this function, the readmore ajax functionality is enabled for all node types by default,So please specify it somewhere that by default it will be enabled for all content types.

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

P.S.: I have not used the whole template because it is already used above and addressed the missing things.

I have seen you have fixed the above security issue.I have seen no major api problem,security issue and license problem.So marking this to RTBC.
I think @mpdonadio forget to remove the review bonus tag from the application.
In the meanwhile I would encourage you to get another review bonus by reviewing 3 more project applications.

naveenvalecha’s picture

As discussed with klausi over IRC,The removing of the bonus tag to the reviewers, they can do it if they want, but they don't have to.

the project page also needs a little more cleanup.See for more information https://www.drupal.org/node/997024

xdevx’s picture

I have implemented your recommendations.
And project page https://www.drupal.org/sandbox/artmix/2366527

naveenvalecha’s picture

Addressed my above points.
Commit history : "finish", "finish2", "finish3" Use the proper commit messages.See https://www.drupal.org/node/52287

mpdonadio’s picture

Manual Review

Review of the 7.x-1.x branch (commit 3db5c9f):

PHPStorm is warning about a few of the docblocks b/c bad syntax. See https://www.drupal.org/coding-standards/docs

You config form can be moved to an include. This can help with memory. See the docs for hook_menu(). Oops. This was already done.

Node access problem is gone; I explicitly tested it and got the 403 text in the AJAX response.

Not seeing any blocking issues.

mpdonadio’s picture

Status: Reviewed & tested by the community » Fixed

This was RTBC and new features brought this above the waterline for vetted access, so...

Thanks for your contribution, artmix !

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.

Status: Fixed » Closed (fixed)

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