Download & Extend

Theming error with biblio_category_separator_bar and biblio-inline

Project:Bibliography Module
Version:6.x-1.7
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi,
sorry if I missed it when searching the errors...

There seems to be a problem with _biblio_category_separator_bar. It uses a static _text variable. If it is filled, the function will first write a closing </div><!-- end category-section --> before opening the new separator bar.

The problem occurs when you have page where you biblio_db_search twice, e.g.

My Papers: <?php biblio_db_search('author','Myself','inline'); ?>
blabla
Additional papers of our group: <?php biblio_db_search('citekey','workgroup','inline'); ?>

In the second call of biblio_db_search the static _text will still be filled, so this results in a code like this:
<div class="biblio-noyear"><div class="biblio-inline">
</div><!-- end category-section -->
<div class="biblio-separator-bar">2008</div>
...

and this destroys the styling of the whole page as you can imagine. Sorry for not offering a patch, but I haven't found a quick solution for this :-(

Comments

#1

Yes, I see the problem. Looks like we need to indicate to the function either via a new argument or via the attrib array that the incoming call should reset $_text.

Ron.

#2

Like passing a call-by-reference variable down from biblio_show_result? I guess it should be safe to reset in every new call to biblio_show_result...

#3

Yes, I'm thinking something like

function _biblio_category_separator_bar($attrib, $node, $reset=FALSE) {
  static $_text = '';
  if ($reset) {$_text=''; return;}
....

Then either before or after the...

  while ($node = db_fetch_object($result)) {

... loop in biblio_show_results() make a call to _biblio_category_separator_bar(NULL, NULL, TRUE);

#4

Status:active» needs review

Tried your code and it fixes all problems at our site.

AttachmentSize
biblio_separator_bar_reset.patch 641 bytes

#5

Status:needs review» fixed

Committed: http://drupal.org/cvs?commit=286952

Ron.

#6

Status:fixed» closed (fixed)

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

nobody click here