Hi, this is a follow-up to #1349090: Proper way to delete/rename files, with 6.x-1.6.

Originally: implemented a theme_form_element() call within my theme. Inside of mytheme_form_element(), I had a call like this:

drupal_add_js(drupal_get_path('theme', 'mytheme') . '/js/jquery.example.foo.js');

This was working, however I needed to rename all of my theme Javascript files consistently. So I did that, and manually renamed jquery.example.foo.js to jquery.example.js. I verified this is named properly and I can manually fetch it from my site. I then changed the theme hook as follows:

drupal_add_js(drupal_get_path('theme', 'mytheme') . '/js/jquery.example.js');

At this point, for good measure I did a full drush cache clear of all things theme related. I also went into advagg and did a "Flush AdvAgg cache", and eventually did a "Force all counters to be incremented by one".

When I review the bundler raw grouping info, I still see references to the old jquery.example.foo.js file in the bundles. I do NOT however see references to the new jquery.example.js file. After browsing around the site to the proper pages, I still don't see the correct and newly named jquery.example.js file show up.

To trick things into perhaps re-generating a proper JS bundle, I changed the max number of JS bundles per page from 4 to 3. That did change it to 3 bundles per page, but the JS scripts still are not showing up in the bundles.

The net result is Javascript is quite broken on the site, as the renamed files aren't being picked up in any bundle. I am contemplating a master reset, but the last time I did that created an issue as well because of the bundle naming/versions and the upstream CDN.

Advice would be much appreciated.

Comments

rjbrown99’s picture

I should also mention that Information -> JS files only shows a reference to the old jquery.example.foo.js, and not the renamed file.

changed 2 times - sites/all/themes/mytheme/js/jquery.example.foo.js

I also see it under Information -> Missing Files

sites/all/themes/mytheme/js/jquery.example.foo.js

I also ran the advagg cron hook a few times for good measure, did not help.

mikeytown2’s picture

Can you copy the debug info in this issue?
Add this to the url of a page that is having issues ?advagg-debug=1

rjbrown99’s picture

My completely unscientific "fix" to this was to root around in the advagg_files table, find the referenced files that were renamed (and still had the old names), and rename them in the db:

UPDATE  `mydb`.`advagg_files` SET  `filename` =  'sites/all/themes/mytheme/js/jquery.example.js' WHERE  `advagg_files`.`filename_md5` =  '5a58dcf3e9a6db985ebcf752d43304aa';

Per the query, I left the old MD5 checksum. Next, I went into the advagg UI and did a standard "Flush AdvAgg Cache", which detected a changed MD5 value and regenerated the cache files. It's working now, and my files are now included properly. So my issue is resolved, but there could be a bug here somewhere.

rjbrown99’s picture

I'll do that, but it's going to have to be in my dev environment as I just fixed prod. Give me a day to sync them up properly.

rjbrown99’s picture

That was helpful, saw DB errors in watchdog. Then enabled schema module and saw...

advagg_files
  filesize: not in database
  indexes filesize: missing in database
advagg_bundles
  indexes root_timestamp: missing in database

I re-ran update.php and it updated the schema accordingly. I then forced all counters to increment by one to ensure that everything was rebuilt properly.

The good news is this fixed the schema error, but the bad news is I still have files that aren't being properly loaded on the page. This is including the jquery_update replaced JS files, which I did not change or rename.

I now have a advagg-debug capture - what am I looking for?

mikeytown2’s picture

upload the capture as a text file. Looking for things not matching.

mikeytown2’s picture

Status: Active » Postponed (maintainer needs more info)

This still an issue?

rjbrown99’s picture

It was the last time I tried it, but I worked around it per #3. I don't think it's "fixed" but it's not bothering me anymore.

mikeytown2’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Going to close this issue out. Open to patches :) if this is an issue with a later version of the 6.x branch.