patch attached to provide drupal head/4.7 compatability.

Comments

moggy’s picture

StatusFileSize
new2.41 KB

modules that create nodes need to supply their own title now.

patch updated to include this.

andykemp’s picture

Has this been updated in the csv copy yet? As I have a windoze server and so can't patch the file myself!

devinhedge’s picture

Assigned: Unassigned » devinhedge
Status: Needs review » Reviewed & tested by the community

I confirmed this patch. It's running on my website www.devinhedge.com.

devinhedge’s picture

To be clear, I've applied 'quotes.module.to47_0.patch' and it works fine.

devinhedge’s picture

Status: Reviewed & tested by the community » Active

Never mind.

The patched code renders the quote block correctly; however, I can't add new quotes. All that is returned is a blank page. Looks like I hadn't tested throughly enough.

paul-at-murphymaphia.com’s picture

The module needs updating to use the Forms API. I would do it myself and post it but it would be a month before I could get to it.
Can we include legacy.ini to get it functional?

mhutch’s picture

Status: Active » Needs review
StatusFileSize
new28.89 KB

This is a fairly quick patch. I haven't tested it fully, especially the features I don't use.

I updated to the Forms API, and updated the RSS feeds to deal with the new node/revision split. It includes the previous patch.

There were a couple of places where the new form API was not appropriate
-- the lists of quotes. I changed to use GET instead of POST.
-- the list of blocks, as the names and titles should be edited individually, else it won't scale.

Could someone review, and if the code is relatively bug-free it should be okay for a 4.7 release.

inteja’s picture

Applied patch. Mostly works but "My Quotes' page produces error:

warning: implode(): Bad arguments. in /home/vrealms/public_html/includes/form.inc on line 274.

mhutch’s picture

BrianH: That's strange... I don't get that error. Could you add some debugging prints to find out what the bad arguments are? The error is in Druapl core, on one of the Forms API error handling functions, but there's no Forms API use on that page.

inteja’s picture

I should point out that my Drupal install isn't exactly clean. I backed up the Drupal 4.6 database, installed 4.7b6 on a new server, pointed it to the old 4.6 database and ran the update script. This worked fine for the Drupal core, but now I'm going through each of the modules and updating where necessary, so this issue I'm having with the atched quotes module could be entirely my doing.

Back to the issue. I added a print_r() to form.inc and here's the output:

Array ( [#name] => sort [#title] => Sort by [#value] => n.created [#options] => Array ( [n.created] => creation date [n.title] => title [q.author] => author ) )

Array ( [#name] => sort [#title] => Sort by [#value] => n.created [#options] => Array ( [n.created] => creation date [n.title] => title [q.author] => author ) )

Array ( [#name] => order [#title] => Ordering [#value] => DESC [#options] => Array ( [ASC] => ascending [DESC] => descending ) )

Array ( [#name] => order [#title] => Ordering [#value] => DESC [#options] => Array ( [ASC] => ascending [DESC] => descending ) )

Array ( [#name] => limit [#title] => Quotes per page [#value] => 10 [#options] => Array ( [10] => 10 [25] => 25 [50] => 50 [75] => 75 [100] => 100 ) )

Array ( [#name] => limit [#title] => Quotes per page [#value] => 10 [#options] => Array ( [10] => 10 [25] => 25 [50] => 50 [75] => 75 [100] => 100 ) )

Any ideas what could be wrong?

Also I've noticed that quote blocks display fine for both anonymous users and logged in users but the quote content shows "n/a" in place of the actual quote and author when you're logged out (anonymous).

inteja’s picture

Something else strange is that when I go to edit my old quotes now, the mandatory "Title" field is blank, although the quote title is still shown at the top of the page. Could this have something to do with the errors I'm seeing?

mhutch’s picture

Okay, I get those errors now I've looked in the log. I had writing errors to pages tuned off and it displays fine. Although I'm not using the forms API I am using the forms theming functions, and somehow the forms API appears to be kicking in. Will look into it.

None of my quotes have titles, so have not seen that. Will check.

I can see quote block content when logged out. Are you using access filtering in any way?

mhutch’s picture

StatusFileSize
new29.19 KB

Fixed the first two. Need feedback on the access permissions bug before I can fix it.

inteja’s picture

Thanks for the patch!

I had trouble applying it though with cygwin - 15 failures against HEAD and HEAD + previous patch.

I'll look into the access permissions.

mhutch’s picture

Title: Drupal Head/4.7 compatability » Drupal Head/4.7 compatibility

The patch is against HEAD. What were the errors? It may be that patch is treating it differently because I called it .patch instead of .diff.

inteja’s picture

$ patch < quotes_3.patch
patching file quotes.module
Hunk #1 succeeded at 163 (offset 7 lines).
Hunk #2 FAILED at 196.
Hunk #3 FAILED at 248.
Hunk #4 FAILED at 466.
Hunk #5 FAILED at 679.
Hunk #6 FAILED at 706.
Hunk #7 FAILED at 732.
Hunk #8 succeeded at 763 with fuzz 1 (offset -23 lines).
Hunk #9 succeeded at 1019 (offset 107 lines).
Hunk #10 FAILED at 1076.
Hunk #11 FAILED at 1084.
Hunk #12 succeeded at 1139 with fuzz 1 (offset 111 lines).
Hunk #13 FAILED at 1165.
Hunk #14 FAILED at 1209.
Hunk #15 FAILED at 1230.
Hunk #16 FAILED at 1248.
Hunk #17 FAILED at 1327.
Hunk #18 FAILED at 1406.
Hunk #19 FAILED at 1438.
15 out of 19 hunks FAILED -- saving rejects to file quotes.module.rej

mhutch’s picture

StatusFileSize
new47.99 KB

Patch works fine on Ubuntu Dapper using patch 2.5.9 and freshly downloaded CVS quotes.module.

Here's a patched version of the module anyway.

inteja’s picture

I had a look at access permissions as you suggested, but it seems to be something to do with input filters.

It warrants a separate issue report: http://drupal.org/node/55989

green monkey’s picture

I'm not very good at patches, some I get right.. others get me.

Has this patch already been applied to the CVS version for 4.7?

Thanks

mhutch’s picture

Status: Needs review » Needs work

Has this patch already been applied to the CVS version for 4.7?

No, it hasn't yet. No-one with CVS access has looked at this.

If you don't want to use the patch, use the full module posted in #17.

The patch still needs the bugfix from http://drupal.org/node/55989, but I won't be able to create an updated patch for a little while (long story). Till then you can apply the fix manually. I have a couple of other minor changes in my local copy too too..

murari’s picture

Category: feature » bug
Status: Needs work » Active

when mass importing quotes in drupal 4.7 I get this error:

Fatal error: Call to undefined function: array2object() in /home/mur109/public_html/modules/quotes/quotes.module on line 1010

the normal 1 quote at a time works...

jhriggs’s picture

Title: Drupal Head/4.7 compatibility » It's coming
Assigned: devinhedge » jhriggs
Category: bug » task

I have been working on the 4.7 update apart from this issue/thread. I am doing a fairly significant refactoring of all the code in the process. This includes using FormsAPI, the .install system, and some general reformatting. I hope to finish up in the next several days. Hopefully posting this will keep me on task...you can all hold me accountable. ;-)

jhriggs’s picture

Title: It's coming » Drupal Head/4.7 compatibility

Ugh. Didn't mean to change the title.

michelle’s picture

Glad to hear it's coming. Then I can get rid of the Lorem Ipsum placeholder in my theme. :)

Thanks!

Michelle

jhriggs’s picture

Status: Active » Fixed

The 4.7 changes were committed to CVS and tagged last night.

Anonymous’s picture

Status: Fixed » Closed (fixed)