As Coder found many issues with the original port to Drupal 6 (version 6.x-1.0; by the way, how could this port be called version 1.0 with so many issues?!), I had to change quite some code to make it work for me (Drupal 6.15).

There are also some minor (cosmetic) changes which are not necessary, but I feel more comfortable if Coder doesn't complain... ;-)

I've also found 2 issues:

1. The comparicon in line (around) 123 (in published.module):
if ($node->op == 'Submit' && $node->published) {
doesn't work for other languages, so I've changed it to:
if ($node->op == t('Submit') && $node->published) {
I would prefer some other (language independent) solution, so maybe the module maintainer can find a better solution...

2. If there is no record for the node yet, and 0 is entered, the error (duplicate record) is reported. I've added a condition to the line (around) 171, so the code:
if ($published === FALSE) {
becomes:
if ($published === FALSE && ($current != NULL)) {
Also this is a quick fix (altough I've tried to test it as much as possible) andf maybe not the optimal solution...

The patch (incl. fixes to the 2 issues above) is in attachment.

CommentFileSizeAuthor
published.d6#2.diff6.67 KBluti

Comments

liquidcms’s picture

Status: Active » Needs review

thanks for these - will take under consideration.

we are just about to release the D6 version of the site which this module was designed for and i have already made a couple tweaks as we have been testing it out. More testing once site goes live next week.

i am not sure about wrapping the Submit in a t() function; seems like $op should not be translatable. one issue though with it is that i think in D6 Submit is now Save so i made that change.

as for the 2nd part; i think i have fixed something like this; but i also recall i was still seeing a duplicate error msg.. but not sure off the top of my head if for the same reason.

should have things cleaned up by next week or so.

thanks again.

luti’s picture

Version: 6.x-1.0 » 6.x-1.1

@1: For my site, $op == 'Save' test doesn't seem to work unless used with t() function as well (tested with a new 1.1 version). So, I will continue to use it my way, only t('Save') instead of t('Submit').

@2: As much as I was able to test, I am not getting any duplicate records errors reported using && ($current != NULL). So, I will keep it for my site as well... ;-)

liquidcms’s picture

Status: Needs review » Closed (fixed)

fixed dependency on $op being set to "Save" (or anything). (dev ver so far)

and not sure what your other issue was.. so marking as closed.