Extent display problem

General bug reports for the Archon software.

Moderators: paulnsorensen, kylefox2, prom, rishel

Extent display problem

Postby Cristine » Thu Apr 07, 2011 1:14 pm

Some of our extent statements are displaying with a tacked on "Object id #___" after the linear feet. I noticed this was brought up by another user on Jun 30, 2010 (viewtopic.php?f=4&t=720) and at the time, it was identified as a bug that would be fixed in the next release. We're in 3.14 though and still seem to be having the same problem.
Thanks!
Cristine
 
Posts: 1
Joined: Thu Apr 07, 2011 1:04 pm

Re: Extent display problem

Postby paulnsorensen » Tue Apr 12, 2011 1:16 pm

Can you try the solution I just posted here and let me know if it works?
paulnsorensen
Site Admin
 
Posts: 631
Joined: Mon Mar 31, 2008 8:55 am

Re: Extent display problem

Postby lrath » Wed May 25, 2011 12:49 pm

I just upgraded to 3.20 running on linux and am experiencing this problem. The #566 or whatever is now gone, but it still displays "Object" instead of "Cu. Feet" or "Linear Feet" or anything. Any help would be appreciated.

Example: http://archon.brockport.edu/index.php?p ... card&id=21

Thanks! --Logan Rath
lrath
 
Posts: 3
Joined: Wed May 25, 2011 12:48 pm

Re: Extent display problem

Postby paulnsorensen » Wed May 25, 2011 3:55 pm

Logan,

Are you using a custom template? We cannot predict what custom themes or templates will contain, so when you upgrade archon, you have to make sure those are updated manually. If you are using a custom template, you'll have to update it by wrapping any calls to objects variables with getString. For instance,
Code: Select all
<div class='ccardcontent'><span class='ccardlabel'>Extent:</span> <?php echo(preg_replace('/\.(\d)0/', ".$1", $objCollection->Extent)). " " . $objCollection->ExtentUnit; ?>

should be changed to
Code: Select all
      <div class='ccardcontent'><span class='ccardlabel'>Extent:</span> <?php echo(preg_replace('/\.(\d)0/', ".$1", $objCollection->getString('Extent'))). " " . $objCollection->getString('ExtentUnit'); ?>
paulnsorensen
Site Admin
 
Posts: 631
Joined: Mon Mar 31, 2008 8:55 am

Re: Extent display problem

Postby lrath » Tue May 31, 2011 1:34 pm

Nope. We're using the standard template. The getString() function is included. That took away the #566 part, but it still displays "Object". --Logan
lrath
 
Posts: 3
Joined: Wed May 25, 2011 12:48 pm

Re: Extent display problem

Postby paulnsorensen » Thu Jun 09, 2011 3:06 pm

What extent unit are you using? Did you have custom units at one point? Can you also send me the contents of your packages/collections/templates/default/controlcard.inc.php file?
paulnsorensen
Site Admin
 
Posts: 631
Joined: Mon Mar 31, 2008 8:55 am

Re: Extent display problem

Postby lrath » Fri Jul 01, 2011 10:46 am

Here's our table:
mysql> SELECT * from tblCollections_ExtentUnits;
+----+-------------+
| ID | ExtentUnit |
+----+-------------+
| 1 | Cubic Feet |
| 4 | Linear Feet |
| 5 | Items |
| 6 | Folders |
| 7 | Boxes |
| 8 | Photographs |
| 9 | Letters |
+----+-------------+

Here's our controlcard.inc.php:
if($objCollection->Extent)
{
?>
<div class='ccardcontent'><span class='ccardlabel'>Extent:</span> <?php echo(preg_replace('/\.(\d)0/', ".$1", $objCollection->getString('Extent'))). " " . $objCollection->getString('ExtentUnit'); ?>
</div>
lrath
 
Posts: 3
Joined: Wed May 25, 2011 12:48 pm

Re: Extent display problem - solution found

Postby gordieschmitt » Mon Aug 01, 2011 1:56 pm

I think I've found the issue. We saw the same problem using the default templates so I created a new template under collections and edited the file controlcard.inc.php . At around line 53 In the default version you find the line:

<div class='ccardcontent'><span class='ccardlabel'>Extent:</span> <?php echo(preg_replace('/\.(\d)0/', ".$1", $objCollection->getString('Extent'))) . " " . $objCollection->getString('ExtentUnit'); ?>

It works correctly if this line is changed to:

<div class='ccardcontent'><span class='ccardlabel'>Extent:</span> <?php echo(preg_replace('/\.(\d)0/', ".$1", $objCollection->getString('Extent'))) . " " . $objCollection->ExtentUnit->getString('ExtentUnit') ?>


I guess $objCollection->ExtentUnit is an object containing an entry from the Extent_Units table and has two elements; ID and ExtentUnit (causing a little confusion I think), therefore to get the desired output it should be $objCollection->ExtentUnit->ExtentUnit or $objCollection->ExtentUnit->getString('ExtentUnit')

This change should be done in the file collection.inc.php file as well. It may also be incorrect in the collections/template/print/controlcard.inc.php . I searched for other occurrences and the correct format shows up in various places(e.g. I found $this->ExtentUnit->getString('ExtentUnit') in collections/lib/locationentry.inc.php )

There may be a better solution but this seems to fix it for us.

Gordie
St. Cloud State University
gordieschmitt
 
Posts: 9
Joined: Mon Jul 06, 2009 8:23 am

Re: Extent display problem

Postby paulnsorensen » Thu Dec 22, 2011 7:49 pm

I tried that solution, and it didn't seem to work for me. However, I just committed what I think the proper solution should be to github. If you wouldn't mind running a separate instance of archon and connect it to a copy of your database to test it out, I would appreciate the feedback on whether we've finally solved this bug.

Go to https://github.com/archonproject/archon and click the "Zip" button to download the latest code.

Thanks,

Paul
paulnsorensen
Site Admin
 
Posts: 631
Joined: Mon Mar 31, 2008 8:55 am

Re: Extent display problem

Postby mtriehle » Fri May 18, 2012 4:09 pm

Sorry to bump on this, but I think this might still be an issue. Was the fix added to the 3.21-rev build?

I just installed 3.21-rev1 and I'm still experiencing a problem. For example in 3.14 a collection had an extent of "16.5 cubic feet", in 3.21 it says "16.5 object" and it is just blank in 3.21-rev1.

Here are the links:
3.14: http://www4.lib.purdue.edu/archon/index ... &q=earhart
3.21: http://www4.lib.purdue.edu/archon321/in ... &q=earhart
3.21-rev1: http://www4.lib.purdue.edu/archon321r1/ ... &q=earhart

Thanks,
Matt
mtriehle
 
Posts: 20
Joined: Wed Jun 22, 2011 2:57 pm

Re: Extent display problem

Postby beltramie » Thu May 24, 2012 5:08 pm

Hi Matt,

I dont think this has been fixed yet in the official version but I was able to manually debug it.

Try editing this file:
archon/packages/collections/templates/YOURTEMPLATE/controlcard.inc.php
around line 52
Changed:
<div class='ccardcontent'><span class='ccardlabel'>Extent:</span> <?php echo(preg_replace('/\.(\d)0/', ".$1", $objCollection->Extent)). " " . $objCollection->ExtentUnit; ?>
to:
<div class='ccardcontent'><span class='ccardlabel'>Extent:</span> <?php echo(preg_replace('/\.(\d)0/', ".$1", $objCollection->Extent)). " "; ?><?php echo($objCollection->ExtentUnit);?>

Have you tried making these changes yet as a temporary solution until the official release has this part fixed?
beltramie
 
Posts: 157
Joined: Mon Feb 16, 2009 3:58 pm
Location: Carleton College, Northfield MN

Re: Extent display problem

Postby jpelikan » Thu Jun 21, 2012 2:06 pm

We are running version 3.21 rev-1 and the Extent: is blank before and after I applied the workaround. Any other things to try?

Jerry
jpelikan
 
Posts: 5
Joined: Thu Jun 21, 2012 8:59 am

Re: Extent display problem

Postby gjerdery » Fri Jun 29, 2012 9:25 am

Nat's (beltramie) solution worked for me. However in the default template for controlcard.inc.php in ver. 3.21-rev1 the code is slightly different. Here's what I started with, at line 55:

<div class='ccardcontent'><span class='ccardlabel'>Extent:</span> <?php echo(preg_replace('/\.(\d)0/', ".$1", $objCollection->getString('Extent'))) . " " . is_null($objCollection->ExtentUnit)? '' : $objCollection->ExtentUnit->toString(); ?>
</div>

And applying Nat's suggestion looks like this:

<div class='ccardcontent'><span class='ccardlabel'>Extent:</span> <?php echo(preg_replace('/\.(\d)0/', ".$1", $objCollection->getString('Extent'))) . " "; ?><?php echo( is_null($objCollection->ExtentUnit)? '' : $objCollection->ExtentUnit->toString()); ?>
</div>

It is interesting to note that the default collection.inc.php template in 3.21-rev1 already uses the above strategy of dividing the Extent line into two php statements, at line 84.
gjerdery
 
Posts: 20
Joined: Tue Apr 05, 2011 7:24 pm

Re: Extent display problem

Postby paulnsorensen » Sat Jun 30, 2012 1:27 pm

gjerdery wrote:Nat's (beltramie) solution worked for me. However in the default template for controlcard.inc.php in ver. 3.21-rev1 the code is slightly different. Here's what I started with, at line 55:

<div class='ccardcontent'><span class='ccardlabel'>Extent:</span> <?php echo(preg_replace('/\.(\d)0/', ".$1", $objCollection->getString('Extent'))) . " " . is_null($objCollection->ExtentUnit)? '' : $objCollection->ExtentUnit->toString(); ?>
</div>

And applying Nat's suggestion looks like this:

<div class='ccardcontent'><span class='ccardlabel'>Extent:</span> <?php echo(preg_replace('/\.(\d)0/', ".$1", $objCollection->getString('Extent'))) . " "; ?><?php echo( is_null($objCollection->ExtentUnit)? '' : $objCollection->ExtentUnit->toString()); ?>
</div>

It is interesting to note that the default collection.inc.php template in 3.21-rev1 already uses the above strategy of dividing the Extent line into two php statements, at line 84.


And neither method works? Or just Nat's?

If Nat's work and the current one doesn't can you make the changes on github? https://github.com/archonproject/archon
paulnsorensen
Site Admin
 
Posts: 631
Joined: Mon Mar 31, 2008 8:55 am

Re: Extent display problem

Postby jpelikan » Mon Jul 02, 2012 12:08 pm

Unfortunately, no neither of the work arounds nor did the changes on github cause My instalation of Archon 3.21 rev-1 to display anything other than the title "Extent:". Any other thoughts?

Jerry
jpelikan
 
Posts: 5
Joined: Thu Jun 21, 2012 8:59 am

Next

Return to Archon Bugs

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron