CVS edit link for MCP

i wrote a module that provides a feature that doesn't exist yet
CommentFileSizeAuthor
#6 editlnk-6.x-0.3.tar_.gz2.42 KBAnonymous (not verified)
#5 editlnk-6.x-0.2.tar_.gz20 KBAnonymous (not verified)
#1 editlnk-6.x-0.1.tar_.gz2.13 KBAnonymous (not verified)

Comments

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new2.13 KB

on sites, where anonymous users are allowed to post content, theres sometimes the problem, that the users can't edit the content they posted afterwards. this module creates a link the anonymous user can use to edit his node afterwards.

avpaderno’s picture

Status: Needs review » Needs work
Issue tags: +Module review

Hello, and thanks for applying for a CVS account. As per requirements, the motivation message should also include a description of the module features, and a comparison with the existing solutions.

Anonymous’s picture

i looked at all the modules containing the word anonymous in the description and found no module that does something like my module. there was a problem description in july (http://drupal.org/node/844780) which the editlnk module could solve.
the module features: after commiting content as an anonymous user, the module provides a link to the user, which he or she can use to edit the content afterwards without having to register at the site.

jonhattan’s picture

Hi MCP. I haven't run the module but looking at the code here are some things to improve:

1/
Coding standards: You are using different indentation across functions. Drupal standard is two whitespaces. Also some docstrigs are not well formed. You can use coder module for this purpose.

2/

  $link = $GLOBALS['base_url']."/node/".$node->nid."/edit/".$password;

instead use url("/node/".$node->nid."/edit/".$password, array('absolute'=>TRUE)).

3/
it is just a suggestion: inform the user that the edit link is valid for a period of N days.

4/
other suggestion:

  $items['node/%node/edit/%'] = array(

you can create a function called editlnk_load() and use $items['node/%node/edit/%editlnk'] so it loads an editlnk object and pass it to editlnk_access().

5/
I think you're showing an edit link for everyone and it should only be given to anonymous users.

6/
other suggestion: remove edit links (via hook_cron) two or three days after the link has expired.

7/
perhaps instead of selecting valid content types. Make it work for content types which anynymous is allowed to post.

8/

  $row->nid = $node->nid;
  $row->editlnkid = $password;
  drupal_write_record('editlnk', $row);

This code raises a warning in E_STRICT mode and also in php 5.3. Create the object first.

9/
leverage user_password() to obtain a random alphanumeric string.

10/
I wanna use this module! :)

Anonymous’s picture

StatusFileSize
new20 KB

1/ fixed (coder says so ;))
2/ fixed
3/ fixed
4/ i will look into that
5/ fixed
6/ fixed (not tested yet)
7/ working on that
8/ fixed, i hope
9/ fixed
10/ thanks ;)

the module now saves a timeout-timestamp (when the editlink won't be valid anymore) in the database. so if the period of days is changed afterwards, that only effects new nodes. but its easier to delete the old editlinks that way. comments?

Anonymous’s picture

StatusFileSize
new2.42 KB

7/ is now also fixed

Anonymous’s picture

Status: Needs work » Active

would be great if someone could take a look at this request again

avpaderno’s picture

Status: Active » Needs review
zzolo’s picture

Component: Miscellaneous » miscellaneous
Status: Needs review » Postponed

Hi. Please read all the following and the links provided as this is very important information about your CVS Application:

Drupal.org has moved from CVS to Git! This is a very significant change for the Drupal community and for your application. Please read the following documentation on how this affects and benefits you and the application process:
Migrating from CVS Applications to (Git) Full Project Applications

  • The status of this application will be put to "postponed" and by following the instructions in the above link, you will be able to reopen it.
  • Or if your application has been "needs work" for more than 5 weeks, your application will be marked as "closed (won't fix)". You can still reopen it, by reading the instructions above.
avpaderno’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

I am changing the status to Won't fix, since the OP doesn't have an account anymore.

avpaderno’s picture

Component: miscellaneous » new project application