I am the author of uc_addresses and recently received this bug: #367811: Error message: failed to open stream: No such file.

After researching this, I found #298331: JS error when locale module is enabled. The bug was in uc_add_js() and the fix was to replace all uc_add_js() calls with drupal_add_js().

That's great, but uc_add_js() is still sitting there in uc_store.module ready to trip up any UC module writers who didn't get the memo. The code in uc_add_js() is not exactly like the code reported in bug 298331, but a grep through the UC code shows that there are no calls to uc_add_js(). This implies that uc_add_js() shouldn't be used.

Please consider taking one of these three actions:

  • Remove uc_add_js() from the uc_store module.
  • Leave uc_add_js() but make it a synonym for drupal_add_js().
  • Leave uc_add_js(), make it a synonym for drupal_add_js(), but display a warning or write a warning to the watchdog telling people that uc_add_js() should be replaced with drupal_add_js().

The first two options are quick and easy. The last option seems the safest.

CommentFileSizeAuthor
#1 uc_store.uc_add_js.patch1.27 KBcha0s
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cha0s’s picture

Assigned: Unassigned » cha0s
Status: Active » Needs review
FileSize
1.27 KB

I agree that the last option is the safest bet to keep existing code working, and I have added a watchdog entry as you suggested. =)

cha0s’s picture

*bump*

freixas’s picture

Apologies for the delay.

The patch looks great. I can do some limited testing this weekend. Even when I was calling uc_add_js(), I wasn't getting the error message "failed to open stream". But at least I can change my drupal_add_js() calls back to uc_add_js() and see if the watchdog warnings show up properly,

Island Usurper’s picture

Status: Needs review » Fixed

Makes sense to me. Committed.

Status: Fixed » Closed (fixed)

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