0

I've recently upgraded a site to the latest release of Drupal 7. The site has a view that retrieves a url with query string parameters from the database and then uses the Drupal rewrite functionality to add a class to the link like so: <a class="purple-button pull-right" href="[field_database_link-url]" target="_blank">View</a>

The issue is, since the upgrade the rewrite now removes the query string parameters. If I modify the view to display a simple link the parameters are there and it works fine. However, the rewrite applies styling to present a button rather than a simple link. I can't find any settings to resolve the issue so I suspect the upgrade overwrote a modification to the Drupal core made by the original developer of the site. Any idea how I can address this issue?

1

It turns out that there was a bug in the latest release that in /modules/contrib/link/link.module that was causing the query strings to be stripped from the URL in the token. I replaced the code in this file with the code from the pre-upgrade version and it began behaving as expected again. This, of course, is not a resolution to the issue, but at least the source of the problem has been identified. For more info, see the original bug report.

I later found that there is a patch for this issue in the dev version (7.x-1.x-dev) of this module. Download this module and replace it in your install and you should be all set.

0

oh ugh that is UGLY. I wish everyone would know DO NOT MODIFY core files!

Unless you have a backup you are pretty much dead in the water. Well you can recreate functionality but that's annoying if it was working. If you don't have a backup use this experience as a boot to get you backing up properly - take weekly database backups (or daily or monthly depending on site change rate) and a full database and code backup before upgrading. I would suggest the Backup/Migrate module to make that easy and mostly automated.

If you do have a backup do a diff between the version it was and the backup to find what files were changed and then get those changes out and into a module if possible.

1
  • I did have a backup and performed a diff but unfortunately there were almost 2800 files that had been modified. A bit more research led me to the solution below. Feb 19 '15 at 4:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.