Since upgrading from Biblio-6.x-1.7 to Biblio-6.x-1.8 (and still in Biblio 6.x-1.9) fields are not displayed after selecting a publication type.

When I create a new biblio entry and select a publication type the script is working for some time. However, when it has finished no fields are shown. I have still the same form with only "Paste", "DOI lookup" and "Publication Type" shown.

I guess that their might be an error in the conditions in line 1107 to 1110 of the 1.9 biblio.module.

Comments

rjerome’s picture

Do you have any caching turned on?

The only other thing I can think of is some other module is resetting the $form_state['storage'] array. If I recall correctly I ran into this with the ctools module.

p0732658’s picture

Priority: Normal » Critical

I'm having the same problem. It appeared in version 6.x-1.8 and is still there in the latest dev version. The probleme is there when I try to create a new biblio item or to edit one that already exist. I tried to desactived all my modules but it didn't help. I even tried installing biblio in an localhost setup whit no other modules activated, but that din't help either.

Denis

rjerome’s picture

Strange, I haven't seen this on any of the machines I test on. What version of Drupal and PHP are you guys using?

p0732658’s picture

PHP 5.2
Drupal 6.14

rjerome’s picture

Hmmm, this is going to require a little debugging on your part 'cause I still can't reproduce it.

One thing to try first would be to add a "default:" case to the switch in the validate function, so could you add a line after line 1554 in the biblio.module file, like this and see if that makes any difference...


      ....

      else {
        form_set_error('bibtex_data',t('There does not appear to be any bibtex data to work with '));
        return;
      }
      break;
    case t('Save'):  // <---- Line 1554
    default:           // <---- ADD THIS LINE

      if ($form_state['storage']['biblio_type'] == $form_state['values']['biblio_type'] ||
         (!empty($form['#node']->biblio_type) && $form['#node']->biblio_type == $form_state['values']['biblio_type']))
      {
        unset ($form_state['storage']);
      }
      else {
        $form_state['storage']['biblio_type']  = $form_state['values']['biblio_type'];
        $form_state['submitted'] = TRUE;
        return;
      }

    ...
p0732658’s picture

In my case, the problem seem to be cause by the Local module. I've came to this conclusion after desactivating/activating my modules. With Locale desactivated, Biblio works fine, but it I activate this module the problem reappers. Maybe meneteqel should try to desactivate this module on his installation...

rjerome’s picture

Ahhh, I know what the problem is now! At the beginning of the biblio_form_validate function there are some lines like this...

function biblio_form_validate($form, & $form_state) {

  $op = isset($form['#post']['op'])?$form['#post']['op'] :
        ($form['#post']['biblio_type'] > 0 ? 'Save' : '');

that should be changed to this...

function biblio_form_validate($form, & $form_state) {

  $op = isset($form['#post']['op'])?$form['#post']['op'] :
        ($form['#post']['biblio_type'] > 0 ? t('Save') : '');  // <-- NOTE the "Save" in this line is now wrapped in the t() function.
p0732658’s picture

Yep, that did the trick for me! Thank you very much!

lagupe’s picture

I tried the suggested changes but it didn't help me. I'm still having the same problem.

I've tried as Administrator and as standard user. Running Drupal 6.15 and PHP 5.2.9

rjerome’s picture

Could you try the latest -dev version (http://ftp.drupal.org/files/projects/biblio-6.x-1.x-dev.tar.gz) and see if it works.

meneteqel’s picture

The change to a translatable string solveld the problem for me, too.
Thank you very much!

rjerome’s picture

Hmmm, looks like I'm going to have to make another release pretty soon since this is a rather nasty bug :-(

rjerome’s picture

Status: Active » Fixed

I'm going to call this fixed with this commit... http://drupal.org/cvs?commit=303866

Status: Fixed » Closed (fixed)

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