The file.inc changes in drupal6.patch file fail due to changes in file.inc in 6.28 release.

in 6.27:
// Strip file_directory_path from $path. We only include relative paths in urls.

in 6.28:
// Strip file_directory_path from $path. We only include relative paths in URLs.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

douglasmiller’s picture

I also had this issue. The includes/file.inc file in core has been modified in the latest version 6.28.

The patch supplied by the CDN module fails to apply because some line numbers have changed.

I rerolled the patch and it applies cleanly to a fresh download of drupal-6.28 with the following command:
patch -p1 < /path/to/patch.patch

douglasmiller’s picture

Status: Active » Needs review

status update

Status: Needs review » Needs work

The last submitted patch, cdn-patch-fails-6.28_1893170.patch, failed testing.

jcamfield’s picture

Despite the test warnings above; I was able to apply this patch to a 6.28 environment, and it appears to be working great. Thanks!

douglasmiller’s picture

Version: 6.x-2.5 » 6.x-2.x-dev
Status: Needs work » Needs review
FileSize
7.77 KB

It appears that I originally posted the patch that CDN suggests applying to Drupal 6.

I meant to post this attached patch, which is only supposed to update the original CDN patch file. So this is a patch for a patch...

Wim Leers’s picture

Status: Needs review » Fixed
jcamfield’s picture

Just a note, updating to the dev branch and running the patch currently throws a lot of fails, and the status report shows

This patch has not been properly applied to the following files (or the patch has been updated):
/HOME/USER/SITEROOT//

Patch fails:
patching file common.inc
Hunk #1 FAILED at 1934.
Hunk #2 FAILED at 1954.
Hunk #3 FAILED at 2342.
Hunk #4 FAILED at 2357.
4 out of 4 hunks FAILED -- saving rejects to file common.inc.rej
patching file file.inc
Hunk #1 FAILED at 34.
1 out of 1 hunk FAILED -- saving rejects to file file.inc.rej
patching file form.inc
Hunk #1 FAILED at 1997.
1 out of 1 hunk FAILED -- saving rejects to file form.inc.rej
patching file theme.inc
Hunk #1 FAILED at 1033.
Hunk #2 FAILED at 1286.
2 out of 2 hunks FAILED -- saving rejects to file theme.inc.rej
patching file template.php
Hunk #1 FAILED at 95.

douglasmiller’s picture

@jcamfield:

What version of Drupal 6 are you running? What command did you use to apply the patch?

I just downloaded a fresh version of Drupal 6.28. I cloned the CDN 6.x-2.x repository. I then applied the included patch successfully using both of the follow commands:

Using the standard patch command from the drupal root directory:
patch -p0 < sites/all/modules/cdn/patches/drupal6.patch

Using git apply (only works if the entire drupal install is in a repository):
git apply --index sites/all/modules/cdn/patches/drupal6.patch

bshensky’s picture

Version: 6.x-2.x-dev » 6.x-2.6
Status: Fixed » Active

@jcamfield and @c4doug:

Ditto #7 here - same patch messages and same failure.

Performed a "drush up" which took core from 6.24 to 6.28. The update also took CDN up to 6.x-2.6 released on 10 Mar 2013.

The command used was (from Drupal root):
$ cp sites/all/modules/cdn/patches/drupal6.patch .
$ patch -p0 < drupal6.patch

Result:

patching file b/includes/common.inc
Hunk #1 FAILED at 1934.
Hunk #2 FAILED at 1954.
Hunk #3 FAILED at 2342.
Hunk #4 FAILED at 2357.
4 out of 4 hunks FAILED -- saving rejects to file b/includes/common.inc.rej
patching file b/includes/file.inc
Hunk #1 FAILED at 34.
1 out of 1 hunk FAILED -- saving rejects to file b/includes/file.inc.rej
patching file b/includes/form.inc
Hunk #1 FAILED at 1997.
1 out of 1 hunk FAILED -- saving rejects to file b/includes/form.inc.rej
patching file b/includes/theme.inc
Hunk #1 FAILED at 1033.
Hunk #2 FAILED at 1286.
2 out of 2 hunks FAILED -- saving rejects to file b/includes/theme.inc.rej
patching file b/themes/garland/template.php
Hunk #1 FAILED at 95.
1 out of 1 hunk FAILED -- saving rejects to file b/themes/garland/template.php.rej

Could it be that an incremental drush update from 6.24 makes core somehow different from a virgin 6.28?

coling’s picture

After the commit http://drupalcode.org/project/cdn.git/commit/609ea76a36941b46cf4dbd4eb89... and updating to the v6.x-2.6 (2013-Mar-10) version of the plugin, the status check page of drupal reports that the patch is not applied.

This is due to the fact that the patch itself changed from an svn format patch to a git format patch and the code that parses the patch to perform the check was not updated.

I've attached a small patch that fixes this up and parses the git format patch. Feel free to apply it under whatever license you need etc. etc.

tonu110’s picture

Hello,
I am using drupal 6.28(upgraded from 6.26). First I have applied the patch supplied in #1, then i applied the patch in #5 successfully (each hunk succeeded). But status report and *admin/settings/cdn* still telling me to "apply the patch". Then I patched another file as told in #10.
But nothing changed. Please tell me the problem and exact order to apply all these patches, I have all the original files backed up, so I am ready to start from start.
OR can any one give me one single patch for all?

Please help
Thanks

douglasmiller’s picture

@manish110

The correct patch to apply should be available in the 6.x-2.6 version of CDN, which includes everything in this issue. If you are having problems applying that patch, then please create a new issue.

tonu110’s picture

Hi c4doug,

Thanks for rply.
This patch is meant for patching 5 files i.e. includes/common.inc, file.inc, form.inc, theme.inc and themes/garland/template.php. So can you please give me the all 5 patched files.

austintnacious’s picture

Title: Patch file fails with Drupal 6.28 » Patch file STILL fails with Drupal 6.28 + CDN 6.x-2.6
Priority: Normal » Critical

First, if there is a problem which has people chasing their tails for hours over the course of weeks and that problem is reported on the Drupal status page then it is an issue of CRITICAL priority. I'm as busy as the next guy (tho' not as clever as those who, for example, create patches to patch patch files and other such contorted brilliance) and I RELY on the Drupal status report to tell me what is going on with my sites if a problem is reported there it's a problem and if I and others spend hours and others are encountering the problem over the course of weeks that's CRITICAL and deserves the full attention of the relevant parties to get the problem fixed. This is a bug repot, it's critical and it's active.

I have installed and re-installed the patches as given in the patch file downloaded with CDN 6.x-2.6 to Drupal 6.28 and the status report still tells me that CDN is in fall-back due to no patch / poorly applied patch / or patch update.

There is a problem, a CRITICAL problem, a problem introduced in a major release, a full release, subverting the whole effing point of software version-ing and you guys are tripping over each other trying to create the cleverest patch-for-a-patch.

Someone, with the appropriate level of skill and experience, please take the reigns, diagnose the problem correctly, fix it and make the fix available to end user morons like myself. . . please!

I'm not that guy / gal unfortunately but I do have something that might be a clue for him / her.
The status report page shows the following:

This patch has not been properly applied to the following files (or the patch has been updated):
/path/to/nowhere//

Yes that is a path ending in 2 "/" but with no files listed and without ./includes or ./themes (the directories containing the files to be patched) given as part of the "path to nowhere"!

So it seems to me from that that CDN 6.x-2.6 does not know where to look when checking whether the patch is applied, so not knowing where to look it does what it should which is to go into fall-back even if the patch is in fact applied.

Anyone!?

bshensky’s picture

Not sure how to make this any clearer, but #10 is surely onto the root of the problem, and #14 adequately expresses my frustration. Here's a log of a completely clean install with the core patch failing. The installs come from the tarballs with no git in the mix anywhere.

I'm still a git virgin. Can someone post the shell-level commands to allow me to execute the git-style versions of the proper patch?

bshensky@dev2:~/tmp$ wget http://ftp.drupal.org/files/projects/drupal-6.28.tar.gz
--2013-04-29 12:18:46--  http://ftp.drupal.org/files/projects/drupal-6.28.tar.gz
Resolving ftp.drupal.org... 140.211.166.134
Connecting to ftp.drupal.org|140.211.166.134|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1105942 (1.1M) [application/x-gzip]
Saving to: `drupal-6.28.tar.gz'

100%[======================================================================================================================>] 1,105,942   1.76M/s   in 0.6s

2013-04-29 12:18:46 (1.76 MB/s) - `drupal-6.28.tar.gz' saved [1105942/1105942]

bshensky@dev2:~/tmp$ tar zxf drupal-6.28.tar.gz
bshensky@dev2:~/tmp$ cd drupal-6.28/sites/all/
bshensky@dev2:~/tmp/drupal-6.28/sites/all$ mkdir modules
bshensky@dev2:~/tmp/drupal-6.28/sites/all$ cd modules
bshensky@dev2:~/tmp/drupal-6.28/sites/all/modules$ wget 'http://ftp.drupal.org/files/projects/cdn-6.x-2.6.tar.gz'
--2013-04-29 12:20:20--  http://ftp.drupal.org/files/projects/cdn-6.x-2.6.tar.gz
Resolving ftp.drupal.org... 140.211.166.134
Connecting to ftp.drupal.org|140.211.166.134|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 64115 (63K) [application/x-gzip]
Saving to: `cdn-6.x-2.6.tar.gz'

100%[======================================================================================================================>] 64,115       381K/s   in 0.2s

2013-04-29 12:20:20 (381 KB/s) - `cdn-6.x-2.6.tar.gz' saved [64115/64115]

bshensky@dev2:~/tmp/drupal-6.28/sites/all/modules$ tar zxf cdn-6.x-2.6.tar.gz
bshensky@dev2:~/tmp/drupal-6.28/sites/all/modules$ ls -l cdn/patches/drupal6.patch
-rw-r--r-- 1 bshensky bshensky 10220 Feb 28 14:29 cdn/patches/drupal6.patch
bshensky@dev2:~/tmp/drupal-6.28/sites/all/modules$ cd ../../..
bshensky@dev2:~/tmp/drupal-6.28$ patch -p0 < sites/all/modules/cdn/patches/drupal6.patch
patching file b/includes/common.inc
Hunk #1 FAILED at 1934.
Hunk #2 FAILED at 1954.
Hunk #3 FAILED at 2342.
Hunk #4 FAILED at 2357.
4 out of 4 hunks FAILED -- saving rejects to file b/includes/common.inc.rej
patching file b/includes/file.inc
Hunk #1 FAILED at 34.
1 out of 1 hunk FAILED -- saving rejects to file b/includes/file.inc.rej
patching file b/includes/form.inc
Hunk #1 FAILED at 1997.
1 out of 1 hunk FAILED -- saving rejects to file b/includes/form.inc.rej
patching file b/includes/theme.inc
Hunk #1 FAILED at 1033.
Hunk #2 FAILED at 1286.
2 out of 2 hunks FAILED -- saving rejects to file b/includes/theme.inc.rej
patching file b/themes/garland/template.php
Hunk #1 FAILED at 95.
1 out of 1 hunk FAILED -- saving rejects to file b/themes/garland/template.php.rej
bshensky@dev2:~/tmp/drupal-6.28$
bshensky’s picture

FileSize
194.82 KB

An update from my corner...

No actual solving the problem with the patch proper here, but I did take the time to apply the patches by hand - I went into each of the 5 files and altered the code in accordance with the instructions in the rejected patches.

As a result, the CSS and JS path-related problems I was having have disappeared, though CDN is still reporting the error message as reported above:

"This patch has not been properly applied to the following files (or the patch has been updated):
/HOME/USER/SITEROOT//"

I don't recommend this to anyone other than the most desperate developer, but attached are the original 6.28 and post-CDN-hand-patched versions of the 5 files.

With gracious thank yous to all here...

jnutter’s picture

I'm having the same issue. We're going to avoid updating the CDN module until this gets fixed.

Wim Leers’s picture

Title: Patch file STILL fails with Drupal 6.28 + CDN 6.x-2.6 » Doc how to apply new core patch and update the patch checking in status report (follow-up for Patch file fails with Drupal 6.28)
Status: Active » Fixed

1) Sorry for not solving this sooner.

2) The patch is correct. But … it is a *git* patch, and the documentation has not been updated to show how to apply that with the patch command, nor has the status report check been updated.

3) The two correct ways to apply the patch are: git apply drupal6.patch, but also patch -p1 drupal6.patch. (The README still says -p0 instead of -p1.)

4) The changes in #10 to the patch checking code for the status report works correctly for me. Hence I'm including it. Thanks, coling! You've been attributed — that's your first officially listed commit here on d.o :)

http://drupalcode.org/project/cdn.git/commit/5d1ad2293834bc7a3756d1abafb...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

gnassar’s picture

Status: Closed (fixed) » Patch (to be ported)

As it doesn't contain the patch in #10, the green release version of CDN fails to recognize that the patch has succeeded, which breaks some things pretty spectacularly for those of us upgrading from a prior version that was using the patched functionality. (Took me a little hairpulling to figure this out!) Can we get at least that addition backported to release so the "official" green-stable version doesn't break on update?

mr.j’s picture

I just upgraded to the latest recommended/stable release and encountered this same problem.

Please push out a new stable release with the fix in #18 included because the one that is there now is broken.

rocketeerbkw’s picture

Status: Patch (to be ported) » Fixed

Everything is fixed in the latest dev release of cdn.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

gnassar’s picture

Status: Closed (fixed) » Patch (to be ported)

Again (note version # on ticket) -- stable build as published is broken. If dev is working and stable is a crasher, you have a problem. Either pull the stable build or roll a new one.

elektrorl’s picture

Issue summary: View changes

It failed for me with latest dev and Drupal 6.28. Files are patched, but Status report says "Fallback mechanism" and "Not/incompletely applied patch or updated patch".

dstephan’s picture

I just updated the core to 6.33, and CDN to 6.x-2.6, and I'm getting the same error on the status report page that folks have been reporting: "Not/incompletely applied patch or updated patch." I patched the files by hand, and did an auto git patch for redundancy. Anyone figured this out?

Wim Leers’s picture

Status: Patch (to be ported) » Closed (fixed)

So it looks like just doing a new release of the 6.x-2.x branch should fix things for you guys. Please test the dev snapshot in the mean time, I will tag a 2.7 release in the next few weeks.

vishal.sirsodiya’s picture

After apply patch, show error notice
"CDN — Drupal core patch (for complete CDN coverage) Not/incompletely applied patch or updated patch

This patch has not been properly applied to the following files (or the patch has been updated):"

help me :)