I've updated to v 5.x-1.3 and run update.php. Any attempt to access my site now results in the following error message:

Fatal error: Call to undefined function _simplenews_get_vid() in [Path to file]/drupal/includes/common.inc(1352) : eval()'d code on line 5

I've not been able to find any discussions on how to correct this error - any help would be appreciated (esp. since my site is down until I can fix it!)

Comments

sutharsan’s picture

Apparently you have some custom code on your site with requires _simplenews_get_vid(). This has been removed and replace by a variable simplenews_vid.

dougpetch’s picture

Thanks for the quick response! I'm going to have to do some digging, since I haven't added any custom code that interacts w/ simplenews. I tried disabling simplenews template but that didn't have any effect. In the mean time, I've rolled back to v 5x-1.2 and things are working properly. I'm considering removing simplenews and simplenews template and starting from scratch - let me know if you see any issues with that approach.

Again, thanks.

dougpetch’s picture

Turns out that the offending code was in the php code I was using in the "Newsletter" block. Once I removed it I was able to successfully load v 5x-1.3. With that done, I edited the php code and reactivated the newsletter block and, wouldn't you know it, doing so has resulted in the following error code:

Fatal error: Call to undefined function simplenews_vid() in [Path to file]/drupal/includes/common.inc(1352) : eval()'d code on line 5.

Here's the code I'm using. Can you see anything I've done wrong?

    global $user;
    $target_name = "Highlighting_High_Performance";
    $target_tid;
    foreach (taxonomy_get_tree(simplenews_vid()) as $newsletter) {
           if ( $newsletter->name == $target_name ){
              $target_tid = $newsletter->tid;
           }
    }
    if (simplenews_user_is_subscribed($user->mail, $target_tid)) {
          return FALSE;
    }else{
          return TRUE;
    }

(NOTE: I've tried using both simplenews_vid() and _simplenews_vid() )

Thanks.

sutharsan’s picture

use variable_get('simplenews_vid', '')

dougpetch’s picture

Status: Active » Closed (fixed)

That did it. Thanks for your help.