Project page: http://drupal.org/sandbox/greenrover33/1270858
This module prohibit a second person to edit the same node as a first person allready do.
It displays a warn message if 2 persons try to edit a node at the same time.
If the first person start editing it will set a bit and ping it by ajax every 3 minutes.
And release this bit on save or page blur.
If the browser crahes (not able to send onBlur release), the look will timed out after 10 mintues.
It is currently Drupal 6 only
git clone --branch master greenrover33@git.drupal.org:sandbox/greenrover33/1270858.git prohibit_double_edit
git clone --branch 6.x-1.x http://git.drupal.org/sandbox/greenrover33/1270858.git prohibit_double_edit
or for older git clients which don't have the --branch option use:
git clone http://git.drupal.org/sandbox/greenrover33/1270858.git prohibit_double_edit
cd prohibit_double_edit
git checkout --track origin/6.x-1.x -b 6.x-1.x
Comments
Comment #1
klausi* git release branch is missing, see http://drupal.org/node/1015226
* README.txt is missing
* info file: version, core, datestamp at the bottom should be removed, this is added by drupal.org packaging automatically
* prohibit_double_edit_install(): doc block needs formatting, see http://drupal.org/node/1354#hookimpl
* "// rull all update functions" what does that mean?
* Make sure all comment sentences start capitalized and end with "."
* "foreach($functs['user'] AS $func)" code style errors, see http://drupal.org/node/318#controlstruct
* module file: always use 2 spaces indentation
* "@param boolean $json echo json code" parameter description should be on a new line, see http://drupal.org/node/1354#functions
Comment #2
greenrover33 commentedDone.
// rull all update functions" what does that mean? --> changed to --> call all prohibit_double_edit_update_XXXX()
Comment #3
greenrover33 commentedComment #4
klausiReview of the 6.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Please report any bugs to klausi.
Comment #5
greenrover33 commentedFix all
But coder throws an eror with is no error:
+28: [critical] table names should be enclosed in {curly_brackets}
Table name is allready in {}
Comment #6
klausiReview of the 6.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Please report any bugs to klausi.
manual review:
Comment #7
greenrover33 commentedHoply i found all issues.
+9: [minor] There should be no trailing spaces
+6: [minor] There should be no trailing spaces
--> this i dont understand, it is like in the node module
+35: [critical] table names should be enclosed in {curly_brackets}
--> Table name is allready in {}
+16: [minor] in most cases, replace the string function with the drupal_ equivalent string functions
--> in this case it makes no sens, it only waste performance
+29: [minor] Missing parenthesis after function name
--> sorry i dont understand
19- */
87- */
110- */
134- */
--> hope now it is better
prohibit_double_edit_menu(): security problem
--> solved have a look at prohibit_double_edit_checkout() and prohibit_double_edit_node_update()
Thanks for your patience with me.
Comment #8
klausiReview of the 6.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Please report any bugs to klausi.
manual review:
Comment #9
greenrover33 commentedsites/all/modules/pareview_temp/test_candidate/prohibit_double_edit.install:
+6: [minor] There should be no trailing spaces
--> sorry i still not understand this
./prohibit_double_edit.module: comment lines should break at 8
--> ok shorten it from 81 to 79 chars
./prohibit_double_edit.module: The description on the line after the @param/@return documentation is either missing or
--> now i wrote something, why needs to explain $nid or $node ?
Changed code to unix time stamp storing
--> why i dont like that: cause human can not read this in db (debug)
why do you need 2 menu paths?
--> this saves me alot of performance. Hook_view uses alot of performance and will not called with full caching. Will opening in editing mode, with cck, its horible slow. Hook_update will not called on blure page (dont save, simply click away)
Comment #10
greenrover33 commentedComment #11
patrickd commentedReview of the 6.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.
Source: http://ventral.org/pareview - PAReview.sh online service
Comment #12
greenrover33 commentedHoply done )-;
Comment #13
patrickd commentedplease do not change it to RTBC your self, this has to be done by a reviewer who made a manual in-depht review and thinks that this is ready to go
Comment #14
bailey86 commentedThere are a few coding style issues found by using the tool at:
http://ventral.org/pareview
The current results are at:
http://ventral.org/pareview/httpgitdrupalorgsandboxgreenrover331270858git
After some discussions on the reviewers group is looks like this on-line test is the best one to use currently to check your code against code standards. I.e. Once you've tided up those points we can move on to reviewing the code.
I've pulled down a copy of the code and will test it out tomorrow.
Comment #15
bailey86 commentedHi,
I've not used javascript much but am an experienced programmer so should be able to look into your module and hopefully review it.
Since you are using D6 as well would it be possible for you to have a look at my project. The project page is at:
http://drupal.org/sandbox/bailey86/1278830
and the review issue is at:
http://drupal.org/node/1330454
The new module application queue is quite busy at the moment so I think the best way is for us to help each other out by reviewing each others modules.
Thanks,
Kevin
Comment #16
greenrover33 commentedok ix fixed this issues.
I will have a look at you projects when i find the time.
If you dont hear annything this week, than it will be next year.
Merry x-mas
Comment #17
bailey86 commentedPoints list
-----------
1. I've tidied up the English in the project description.
This module prohibits a second person editing the same node which a first person is already editing.
It displays a warning message if two people try to edit a node at the same time.
If the first person starts editing it will set a bit and ping it by ajax every 3 minutes. This bit is then released on save or page blur.
If the browser crahes (not able to send onBlur release), the lock will time out after ten mintues.
2. Change the cloning instructions
The cloning commands should be:
$ git clone --branch 6.x-1.x http://git.drupal.org/sandbox/greenrover33/1270858.git prohibit_double_edit
or for older git clients which don't have the --branch option use:
$ git clone http://git.drupal.org/sandbox/greenrover33/1270858.git prohibit_double_edit
$ cd prohibit_double_edit
$ git checkout --track origin/6.x-1.x -b 6.x-1.x
3. Is this function finished?
RE This function doesn't look quite right - xxxx/6102 - can you explain how this is expected to work? The code is:
/**
* Implements hook_update_xxxx().
* add is edit by bit field to {node} table
*/
function prohibit_double_edit_update_6102() {
$ret = array();
$field = array(
'type' => 'int',
'size' => 'normal',
'description' => 'UnixTimestamp of last seen, ajax, of last edit this node',
);
db_change_field($ret, 'node', 'edit_last_seen', 'edit_last_seen', $field);
return $ret;
}
4. Function comment block
For the function prohibit_double_edit_form_alter(&$form, $form_state, $form_id) the comment block above it does not define the parameters and return value.
This should have a single line on the first line. Look at:
http://drupal.org/node/1354#functions
5. Functionality issue.
I've installed the module and it doesn't seem to do anything.
In separate browsers I've logged into the site twice - both as the user admin. But I am able to edit the same page on both browsers. Are you expecting the users to log in with different names?
Actually I've logged in as different users as well and still can't see any functionality. What am I missing?
Comment #17.0
bailey86 commentedUpdated issue summary.
Comment #18
greenrover33 commentedThanks to bailey86
1.) Ok i use now your description. Thanks for english lesson.
2.) OK use this now
3.) Yes it is finished.
This is the normal way to change a db table with an update in drupal
http://php.net/manual/en/language.references.pass.php
Have a lok at: http://api.drupal.org/api/drupal/includes--database.pgsql.inc/function/d...
4.) Ok use now doc block from original hook
5.) if you do it with the same user it wont work.
The same user now what he do in another windo. Perhaps he like to copy past with 2 screen`s
It only protect against double editing by 2 different users
Comment #19
bailey86 commentedHi,
I did try to run it with two different users logged in via two different browsers - but nothing seemed to happen when I tried to edit the same node in both browsers at the same time.
Am I missing something? Or could you list out a test run through of what steps I should take and what the expected outcome should be showing me and how it stops the double editing.
Cheers,
Kevin
Comment #20
greenrover33 commentedIf fixed now a jQuery.ui, cause of this it was not work correctly in plain isntallations
How to test:
Install new plain 6.22
Create a content page /node/add/page
Create new user /admin/user/user/create
Give new user the permission "edit any page content"
SHELL:
Activate the "Prohibit nodes double edit" and "jQuery UI" module /admin/build/modules
open a second browser (ff and chrome)
Login new user in second browser /user
Open in first and second browser the node from step 2 /node/1
Click EDIT in frist browser (logged in as admin or what ever) /node/1/edit
Click EDIT in the second browser (logged in with an different user then in browser one) /node/1/edit
Comment #21
frobI was wondering how this module is diferent from the Content Lock module.
There are still some coding errors as reported by pareview.
Review of the 6.x-1.x branch:
Drupal Code Sniffer has found some code style issues (please check the Drupal coding standards). See attachment.
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. Get a review bonus and we will come back to your application sooner.
FILE: ...es/all/modules/pareview_temp/test_candidate/prohibit_double_edit.module
--------------------------------------------------------------------------------
FOUND 7 ERROR(S) AFFECTING 7 LINE(S)
--------------------------------------------------------------------------------
45 | ERROR | Array indentation error, expected 6 spaces but found 8
46 | ERROR | Array indentation error, expected 6 spaces but found 8
47 | ERROR | Array indentation error, expected 6 spaces but found 8
48 | ERROR | Array indentation error, expected 6 spaces but found 8
49 | ERROR | Array indentation error, expected 6 spaces but found 8
52 | ERROR | Array indentation error, expected 6 spaces but found 18
53 | ERROR | Array closing indentation error, expected 4 spaces but found 8
--------------------------------------------------------------------------------
Doing a manual review of the code showed that the above is true. Check out http://drupal.org/coding-standards for drupal coding standards.
Comment #22
patrickd commented@frob if you copy from ventral.org/pareview, use the source tab, so all code will be encapsuled in code tags and all links will be linked ;-)
Comment #23
frobReview of the 6.x-1.x branch:
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. Get a review bonus and we will come back to your application sooner.
Source: http://ventral.org/pareview - PAReview.sh online service
Comment #24
klausiJust minor coding standard errors, that should not hold up manual reviews.
Get a review bonus and we will come back to your application sooner.
Comment #25
greenrover33 commented@frob: it does nearly the same like "Content Lock module", we started the development nearly at the same time.
Cause of this its a little duplicated.
My implementation is mutch more light weight but have less configuration options.
It also is more fixed to not look notes for a to long time.
Insted of to be safe as posible, like "Conten Lock" does.
Comment #26
bailey86 commentedMaybe you could look at the Content Lock module and see if you can add an option to not lock notes for too long a time? If it's a good option then it would be good to have it on a single module.
Comment #27
frobWhat I recommend is, post an issue over at the Content Lock module and see if there is any way to collaborate on this problem. Maybe sign-on as a contributor to that module and start a new major branch that includes both ideas.
Post that issue in the Content Lock issue que and then mark this as active with a link to that issue.
Comment #28
klausiProject 1: http://drupal.org/node/1270872
Project 2: http://drupal.org/node/1598666
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
Comment #28.0
klausichange git clone instructions
Comment #29
avpaderno