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.
| Comment | File | Size | Author |
|---|---|---|---|
| published.d6#2.diff | 6.67 KB | luti |
Comments
Comment #1
liquidcms commentedthanks 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.
Comment #2
luti commented@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... ;-)
Comment #3
liquidcms commentedfixed 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.