In the newest dev, nothing is displayed in the columns "Published" and "Sent" at admin/content/simplenews and nothing is displayed in the column "Status" at admin/content/simplenews/users.

Comments

miro_dietiker’s picture

Category: bug » support
Priority: Major » Normal
Status: Active » Fixed

If you replaced your code files manually or via CVS, you need to manually trigger a cache clear (cc).

Some files have been moved and so the theme registry needs to be rebuilt.
You always need to cc your drupal after upgrading some code!

roball’s picture

This is strange since I always do a drush updb after replacing a module's code by a newer one. Anyway I will try the latest 2.0 dev when it is rolled out today afternoon and report back here.

roball’s picture

Category: support » bug
Priority: Normal » Major
Status: Fixed » Active

Since your last change on DRUPAL-6--2 (from today 01:30) was already included in this morning's simplenews-6.x-2.x-dev.tar.gz (rolled out just one minute later - at 01:31) I gave it again a try.

Believe me, I'm 100% sure to have cleared the cache afterwards, both via

drush updb
No database updates required                                                                                               [success]
'all' cache was cleared                                                                                                    [success]
Finished performing updates.                                                                                                    [ok]

and manually via Drupal's GUI (/devel/cache/clear) - just to be double sure -, and the 3 columns in question got again completely empty. After reverting to 6.x-2.x-dev (2010-Nov-23) and again clearing the cache they appeared again. so there is definitely something wrong in the new dev.

miro_dietiker’s picture

roball, can you somehow debug this situation?

You can also believe me i consulted my cvs checkout and did full checks of all corresponding points...

I'll need a system dump (db+files) or access to your system, if you can't debug it yourself!

mkmk’s picture

I am seeing the same error. These columns are blank.

I am also seeing other problems... like cron saying its stuck. And after fixing that, now cron runs but not all letters get sent.

roball’s picture

Priority: Major » Critical

I'm sorry to set this to critical, but this bug prevents me from being able to use the current 6.x-2.x-dev version at all. And I am not the only affected one. The last dev that is working for me is still the snapshot from 2010-Nov-23. Everything that has been released later (including alpha 1) was broken for me :-( so I think it is really important to get back a working dev, in order for being able to release a working alpha 2.

Andreyy’s picture

I have the same problem. Does anybody have dev from 2010-Nov-23 ?

Oh, I found dev from 2010-Dec-15. It works fine in my case.

mattwmc’s picture

I have the same problem AND now there is no option to send the e-mail to the test address or regularly when creating the newsletter node.

*Just noticed I have 6.x-2.0-alpha1 installed.
** 6.x-1.3 fixed the problems.

miro_dietiker’s picture

In 6.x-2.x your send option is in a tab called "Newsletter". The tab functionality has been fixed cleanly in 6.x-2.x-dev.

roball’s picture

Have you been able to reproduce this bug Miro? As you can see in this thread many people are affected.

Phil Wolstenholme’s picture

I have this issue with 6.x-2.x-dev too.

No icons in the published or sent columns, and no emails are being sent. The cron runs fine, no errors are logged but no messages are sent. Editing a newsletter issue node only gives a Save or Preview button - isn't there usually a Send or Test option?

simon georges’s picture

@flipwuk, in 6.x-2.x version, the sending is on a separate tab (the "Newsletter" one). So, there is no alteration of the node edit form any more.

roball’s picture

But the bug with the missing columns is still real. No thoughts about it??

Phil Wolstenholme’s picture

Hi Simon, thanks for that.

I had noticed the extra tab but unfortunately even when the checkbox is checked, greyed out and displaying a ' This newsletter has been sent.' message the newsletter has not been sent.

I thought the missing column information may be a symptom of this problem but if it's not then I'll create a new issue/support request.

webstein’s picture

I'm having the same error...

After updating from 1.3 to 2.0-alpha1 the status icons are not visible anymore.
I already tried alot to fix or find the problem, like all the stuff that's listed above.

Please help cause it's a really annoying bug when you have a large list of e-mail adresses and I don't want to downgrade...

simon georges’s picture

Are you sure you have cleared your theme registry cache ?
(With admin_menu module, you can do it using the Drupal icon at the left, in the sub-menu "Flush all caches" / "theme registry").
I was able to have the same issue as you for a few minutes, with the empty columns, but flushing the theme registry cache was the only thing needed to have everything working again.

roball’s picture

Sure I have cleared the cache.

simon georges’s picture

@roball, I absolutely cannot reproduce the issue... Can you help us debug?
Can you display what you have at the entry of the template_preprocess_simplenews_status(&$variables) (in includes/simplenews.admin.inc) function (the $variables array)?

roball’s picture

I updated to the latest current 6.x-2.x-dev (2011-Mar-06), cleared the cache - same problem.

I added the lines

print '<pre>VAR:';
print_r($variables);
print '</pre>';

directly after "function template_preprocess_simplenews_status(&$variables) {" in includes/simplenews.admin.inc, but it did not print out anything while being on admin/content/simplenews.

simon georges’s picture

Then there seems to be something wrong with the theme registry, because it should pass into this function.

Do you have some custom code that is using hook_theme_registry_alter()?

roball’s picture

No I'm not using hook_theme_registry_alter(). The theme I am using is pixture_reloaded.

miro_dietiker’s picture

Could you please once switch to garland and check?
Possibly admin theme switch to garland could be enough.

Alternatively, try to disable some modules in a test duplicate of your site until it shows up.

We could be able to reduce the issue that way to a specific module or theme.

roball’s picture

Switching the admin theme to garland did not work either. Same result. What I do not understand why at all you did this change when it totally worked fine before and now it doesn't anymore for lots of users. Is there a ticket ID reporting the change that is causing this problem?

miro_dietiker’s picture

roball, we decided to bring more structure into the directory tree. I dunno the exact issue, it might be related to the "separate ~things" issue.

I'm still heavily busy for the next 2 weeks and come back to you to check the live system.

BTW: We recently needed to clear caches on BOTH drush AND apache to cleanly flush all participating caches... Do you have an advanced caching setup?

theorichel’s picture

I had the same problem (in Garland) but flushing the theme registry solved it.

roball’s picture

I don't have an advanced caching setup and cleared all imaginable caches after upgrading to the latest 6.x-2.x-dev (2011-Mar-08). I even emptied the "cache" MySQL table (using phpMyAdmin). Afterwards, applied "Flush all caches" provided by Administration menu (admin_menu/flush-cache?destination=admin%2Fcontent%2Fsimplenews%2Fsent) - all without any success.

As Simon Georges turned out in #20, the template_preprocess_simplenews_status() function is not being called at all. Couldn't you provide some test code that prints out some debug information to see what's going on?

Ela’s picture

subscribing

simon georges’s picture

@Ela, do you have the same issue ? Can you help us debug it ? Have you cleared your caches, or tried with the Garland theme ?

Ela’s picture

Hello,
I did not try with the Gerald theme. I tried both versions, 2.x-dev , then switched to 6.x-2.0-alpha1.
In both the columns are empty. Newsletters are being sent OK. I did clear the caches.
If you need me to try wtih Gerland theme, I will try this evening and report back.

simon georges’s picture

Do you eventually use some kind of opcache, like APC ? If that's the case, could you try re-starting your web server ?

Ela’s picture

I'm hosting my site with hotdrupal. ... can't re-start web server.

webstein’s picture

I still have the same problem BUT I discovered this:

When I enable the option "Rebuild theme registry on every page.", in the configurations tab of my theme (at the bottom under 'Theme development settings'), THEN the problem is gone. But of course it's not good to continuously rebuild the theme registry.
And yes, I cleared all my caches but clearning the caches once does not solve the problem. After disabling the "Rebuild theme registry on every page."-option, the problem is back...

I hope this helps to solve the problem...

julianmancera’s picture

Hi,

I did some debugging on this and for some reason the preprocess hook for theming function of the status column, template_preprocess_simplenews_status() is not being called by the theming engine. I also tried to override this function on my theme mytheme_preprocess_simplenews_status but isn't called by the theme() function.

From the hook_theme definition we have

'simplenews_status' => array(
      'template' => 'simplenews-status',
      'file' => 'includes/simplenews.admin.inc',
      'path' => $path . '/theme',
      'arguments' => array('status' => NULL, 'source' => NULL, 'already_sent' => NULL, 'sent_subscriber_count' => NULL),
    )

I'm not sure if having both "file" and "template" correct, because one is saying drupal to go and fetch a template and in the other hand is saying look for the theming function in 'includes/simplenews.admin.inc. Can you please confirm that if this can work?

I think the correct way will be to only call the theming function as:

'simplenews_status' => array(
      'file' => 'includes/simplenews.admin.inc',
      'path' => $path . '/theme',
      'arguments' => array('status' => NULL, 'source' => NULL, 'already_sent' => NULL, 'sent_subscriber_count' => NULL),
    )

And then the theme function will be something like:

function theme_simplenews_status(&$variables) {
  switch ($variables['source']) {
    case 'published':
      $images = array(0 => 'sn-saved.png', 1 => 'sn-sent.png');
      $title = array(0 => t('Not published'), 1 => t('Published'));
      break;
    case 'activated':
      $images = array(0 => 'sn-saved.png', 1 => 'sn-sent.png');
      $title = array(0 => t('Inactive: no newsletters will be sent'), 1 => t('Active: user will receive newsletters'));
      break;
    case 'sent':
      $images = array(
        SIMPLENEWS_STATUS_SEND_PENDING => 'sn-cron.png',
        SIMPLENEWS_STATUS_SEND_READY => 'sn-sent.png'
      );
      $title = array(
        SIMPLENEWS_STATUS_SEND_NOT => '-',
        SIMPLENEWS_STATUS_SEND_PENDING => $variables['already_sent'] . ' / ' . $variables['sent_subscriber_count'],
        SIMPLENEWS_STATUS_SEND_READY => $variables['sent_subscriber_count'],
      );
      $variables['trailer'] = $title[$variables['status']];
      break;
  }

  // Build the variables
  if (isset($images) && $images[$variables['status']]) {
    $variables['image'] = base_path() . drupal_get_path('module', 'simplenews') .'/'. $images[$variables['status']];
  }
  $variables['alt'] = $variables['title'] = $title[$variables['status']];
  
  //Finally call the a new theming function that fetch the template simplenews-status.tpl
  echo theme('new_status_theme_function', $variables);

}

Let me know your comments

Julian Mancera

simon georges’s picture

Apparently, having "file" & "template" is correct, but the problem could be in the use of "path".
If I believe http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hoo..., "path" is used for both "file" & "template", thus eventually causing a conflict.

Can somebody confirm that ?

julianmancera’s picture

@Simon I think you are correct, the problem seems to be the path, I removed the path variable and I add it to the template array definition as follows and it start to work, can someone confirm this

simplenews.module line 2356

   'simplenews_status' => array(
      'template' => 'theme/simplenews-status',
      'file' => 'includes/simplenews.admin.inc',
      //'path' => $path . '/theme',
      'arguments' => array('status' => NULL, 'source' => NULL, 'already_sent' => NULL, 'sent_subscriber_count' => NULL),
    ),

Julian Mancera

Ela’s picture

I applied the changes, run update.php , refreshed the page admin/content/simplenews and admin/content/simplenews/users

I can confirm that #35 solution works for me. Images are now showing together with numbers :D

simon georges’s picture

Status: Active » Needs review
StatusFileSize
new618 bytes

Patch for those who want to try this solution.
I'll commit (and release a new alpha version) as soon as I have some feedback about it.

roball’s picture

Status: Needs review » Reviewed & tested by the community

Yes, finally... this simple patch from #37 (against 6.x-2.x-dev (2011-Apr-10)) indeed solved the problem! Thank you very much julianmancera for unveiling the wrong use of the Drupal API causing this problem!

drush updb is - as it always was - completely sufficient for clearing the cache - no need to restart the webserver or trying out other strange things.

Thanks again for getting back a working version of Simplenews 6.x-2.x since almost 5 months!

simon georges’s picture

Status: Reviewed & tested by the community » Fixed

Committed ! Thanks a lot to Julian Mancera for the insights, and thanks to the other for the tests and feedbacks !
Now, let's tag a new version.

miro_dietiker’s picture

Great. Thank you all.

Mat77’s picture

Patch in #37 worked for me!

Thanks everyone

roball’s picture

Mat77, you no longer need to patch - just upgrade to 6.x-2.0-alpha2.

Status: Fixed » Closed (fixed)

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