Extent display problem

General bug reports for the Archon software.

Moderators: paulnsorensen, kylefox2, prom, rishel

Re: Extent display problem

Postby gjerdery » Mon Jul 02, 2012 4:42 pm

Hi Paul,
Not sure if this answers your question, but the top example is the original code - it didn't work for me. I just submitted a pull request with the second slug of code, which did work for me.
gjerdery
 
Posts: 21
Joined: Tue Apr 05, 2011 7:24 pm

Re: Extent display problem

Postby gjerdery » Mon Jul 02, 2012 4:46 pm

[quote="jpelikan"]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[/quote]

Hi Jerry,
One possible suggestion - make sure that you are making changes to the right template. I made the changes to my "default" template, but if you are using a different one, or have developed a customized template, you might need to make the changes there.
gjerdery
 
Posts: 21
Joined: Tue Apr 05, 2011 7:24 pm

Re: Extent display problem

Postby Morgon » Fri Jul 06, 2012 11:06 am

I had exactly the same problem (the "Extent" field was blank in Archon's public view), but the solution posted by Nat worked perfectly, and took about 10 seconds to implement. Many thanks to all of you! This forum has helped me out several times now in the past week.
Morgon
 
Posts: 7
Joined: Wed Jul 04, 2012 2:28 pm

Re: Extent display problem

Postby jpelikan » Mon Jul 23, 2012 2:28 pm

[quote="gjerdery"]

Hi Jerry,
One possible suggestion - make sure that you are making changes to the right template. I made the changes to my "default" template, but if you are using a different one, or have developed a customized template, you might need to make the changes there.[/quote]

Yes it is the default template that I applied the changes to.
jpelikan
 
Posts: 5
Joined: Thu Jun 21, 2012 8:59 am

Re: Extent display problem

Postby beltramie » Tue Jul 24, 2012 5:11 pm

Hi,

So did you try applying the change to the custom template you are using, and did that fix the problem?
beltramie
 
Posts: 157
Joined: Mon Feb 16, 2009 3:58 pm
Location: Carleton College, Northfield MN

Re: Extent display problem

Postby jpelikan » Wed Jul 25, 2012 10:32 am

I don't have any custom templates as yet. I am trying to get things to work as expected with the default install before attempting customization.

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

Re: Extent display problem

Postby beltramie » Fri Jul 27, 2012 9:23 am

Several people found the fixes in this thread worked,

viewtopic.php?f=2&t=905&start=0&hilit=extent

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);?>
beltramie
 
Posts: 157
Joined: Mon Feb 16, 2009 3:58 pm
Location: Carleton College, Northfield MN

Re: Extent display problem

Postby jpelikan » Fri Aug 10, 2012 10:48 am

Ok, I finally got it working. Turns out that I had two copies of Archon on the server, The one the browser was looking at and the one I was editing. I deleted the one the web server was not using and made the edits gjerdery wrote. I am now seeing the extents. Success. Thanks for your patients.

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

Re: Extent display problem

Postby djafferian » Wed Jan 23, 2013 2:56 pm

This problem is caused by a coding error, specifically a failure to attend to operator precedence. Here is a proper fix :

Index: packages/collections/templates/default/controlcard.inc.php
===================================================================
@@ -52,7 +52,7 @@
if($objCollection->Extent)
{
?>
- <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 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>
<?php
}
djafferian
 
Posts: 2
Joined: Wed Jan 23, 2013 2:41 pm

Re: Extent display problem

Postby FitoPlancton » Fri Mar 22, 2013 3:16 pm

[quote="gjerdery"]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:
...

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>
...
[/quote]

gjerdery,
this worked fine for me.
Thanks,

Érico Moraes
FitoPlancton
 
Posts: 8
Joined: Wed Jan 14, 2009 10:33 am
Location: Porto Alegre - Brasil

Previous

Return to Archon Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron