Hi,
just started playing with the biblio module. Tons of questions to follow ;-)
First of all I stepped on the same problem when trying to clone a biblio entry with the clone module or when "webfm attachments" are enabled in the workflow settings for biblio (I know that webfm is not supported to show downloads, but I'm going to hack that into biblio I guess, because we are only using webfm attachments on our whole site).
In both cases, no fields are shown. $show_fields remains FALSE because form_state['submitted'] is null. I still don't know why this happens when webfm attachments are enabled, but for cloning it's clear: When cloning a biblio node, you get a new node which already has $form_state['values']['biblio_type'] set because it is cloned from the original node.
Therfore the step for selecting the type doesn't happen and so form_state['submitted'] isn't defined.
When I change the type from e.g. journal to book, then I get the fields and they all show the correct values, so cloning indeed works here.
Question: why do we need form_state['submitted'] to decide if the fields are shown? What about
if (!empty($node->nid) || $tid)
$show_fields = TRUE;
I think it's quite intuitive to say that we show the fields if the node either has a biblio_type already or the type was selected in the drop-down box,
In case of cloning, the cloned node already has a biblio_type, so $tid is defined. And this also solves the problem with webfm because $form_state_tid is defined after selecting the type, and so will $tid.
What do you think? Would this break something else?
Comments
Comment #1
rjerome commentedThe logic (albeit some what of a hack) for using form_state['submitted'] was so that when the form was to detect whether the form was being loaded for the first time or if the user had mad a selection from the "Publication Type" drop down box.
As you rightly pointed out, the same could be accomplished using $tid, and I have done some preliminary testing which doesn't indicate any problems with this approach, so I'll go ahead and change it.
Ron.
Comment #2
Anonymous (not verified) commentedThanks a lot :-)
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
john bickar commentedI'm re-opening this issue instead of creating a new one in the hopes that it's the same bug.
When cloning an existing biblio using the node_clone module, the submit button does not appear. (Actually, nothing below the COinS data fieldset appears.)
I thought it might be a theme or Javascript error, but the error persists in a core theme and with Javascript turned off. The code for the submit button does not appear in the page source code either.
Thanks!
Comment #5
rjerome commentedI've just checked in a fix for this issue... http://drupal.org/cvs?commit=344434
Ron.
Comment #6
john bickar commentedConfirmed that it works.
Thank you!