Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2017-02-27 02:48:10

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Client Response Add-On Questions...

I've finally got round to configuring the Client Response add-on in the new Backlight site I'm building on Bluehost (to replace studios.redvixen.com on my current host which has proven to not serve up Backlight content consistently) and noticed a couple of potential bugs.

The test gallery in question is located at:

http://redvixen-studios.com/galleries/test-album/

(BTW, totally love the new version compared to CE4...much cleaner looking and the help button integrated by default makes it so much more user-friendly!  Well done!)

===

1.  The feedback profile has the "Has Rating" setting set to "Yes" and when I select an image to provide feedback, I can see the stars displayed under the image but cannot select any of them.  When I looked at the stars using the Firefox inspector, there doesn't seem to be a click handler that I can find that would actually update the rating for the feedback.


                <div id="image_id" class="image_rating">
                    <span class="star_1 ratings_stars" data-score="1"><span>1</span></span><!--
                    --><span class="star_2 ratings_stars" data-score="2"><span>2</span></span><!--
                    --><span class="star_3 ratings_stars" data-score="3"><span>3</span></span><!--
                    --><span class="star_4 ratings_stars" data-score="4"><span>4</span></span><!--
                    --><span class="star_5 ratings_stars" data-score="5"><span>5</span></span>
                </div>
           
Looking deeper in the code (specifically jquery.ttgcrg-backlight.js), it does appear a click handler is inserted on the fly by jQuery but it doesn't seem to be firing in any of the browsers I have tried so far (FireFox, Chrome, IE11 Safari on iOS on both iPhone and iPad).

2.  The template used to generate the client response gallery has all six metadata items configured and set to "On" but only the first four are displayed in the feedback popup.  These last two aren't critical but one would think they would be displayed if toggled on:

"crg.metadata.meta05":"on","crg.metadata.meta06":"on","crg.metadata.meta05.title":"Exposure Bias","crg.metadata.meta05.value":"{ExposureBias}","crg.metadata.meta06.title":"Flash","crg.metadata.meta06.value":"{Flash}"

Offline

#2 2017-02-27 16:39:22

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: Client Response Add-On Questions...

The handlers are firing, but throwing errors. I'm not yet seeing the reason. Can you disable metadata items 5 and 6, and see whether that makes any difference? I'm wondering whether there's a relationship between the items not displaying and ratings not working.

If disabling 5 and 6 yields the same result, then also disable item 4 and try again. If there's a problem with item 4, that might be causing 5 and 6 to not display, etc.


Matt

The Turning Gate, http://theturninggate.net

Offline

#3 2017-02-28 02:29:39

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Re: Client Response Add-On Questions...

I ended up disabling all of the metadata items one-by-one until none of them was displayed on the popup...still getting the same result when fiddling with the ratings stars.

Error message in console when hovering over a star:

TypeError: $(...).prevAll(...).andSelf is not a function[Learn More]  test-album:586:12

Error message in console when clicking on a star:

TypeError: $(...).prevAll(...).andSelf is not a function[Learn More]  test-album:604:5

Error message in console on mouse leaving the star:

TypeError: $(...).prevAll(...).andSelf is not a function[Learn More]  test-album:591:6

Those line numbers are roughly two script invocations to resource.php for scaffolding and scripts, respectively...I popped those URLs into the browser window and the server served up the scripts.

I'm going to re-enable the metadata items and restore the template to it's former state for any additional debugging you might need.

Offline

#4 2017-02-28 14:51:30

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: Client Response Add-On Questions...

This is weird. I went back to my source files to take a closer look at the portion of script on which the error is being thrown, and my source is different than what you're running. Might be that Ben updated the script at some point; whether that happened before the current public release, or after (in our development code), I'm not sure. In any case, can you please ensure you're using the most recent release version of the Client Response Add-on? Might even be  best to go ahead with downloading the current release for a fresh install.


Matt

The Turning Gate, http://theturninggate.net

Offline

#5 2017-02-28 15:56:28

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Re: Client Response Add-On Questions...

It looks like I was using Client Response 7.0.1 and didn't realise it wasn't the latest version on offer.  Let's just say that I was thinking of James May's favourite catchphrase when that unfortunate discovery was made...

Updated Client Response to 7.0.2 and the rating stars are now working as expected.   Yay and thank you!  smile

Metadata 5 and 6 are still not being displayed in the popup after updating to 7.0.2 and those items aren't rendered in the crg-metadata DIV for the popup:

<div class="crg-metadata"><dl><dt>Date/Time</dt><dd>18 Feb 2017 16:52:47</dd></dl><dl><dt>Lens</dt><dd>300 mm f/4</dd></dl><dl><dt>Shutter speed /  Aperture</dt><dd>1/320 sec at f/9.0</dd></dl><dl><dt>ISO Speed Rating</dt><dd>800</dd></dl></div>

Interestingly, the metadata is available in the main gallery HTML for each cell (I had to clear the template cache and re-publish the gallery to ensure correct metadata was rendered):

	    <figure id="fig-emw_20170218_165247_Planes_0034" class="color0" itemscope itemtype="http://schema.org/ImageObject">
	    	<div class="album-frame">

										<div class="cellNumber">6</div> 		    	

		      <a class="pswp_go" href="http://redvixen-studios.com/galleries/test-album/emw_20170218_165247_Planes_0034-single.php" data-href="http://redvixen-studios.com/galleries/test-album/photos/emw_20170218_165247_Planes_0034.jpg" data-size="960x641" style="background-image: url(http://redvixen-studios.com/galleries/test-album/thumbnails/emw_20170218_165247_Planes_0034.jpg); top: 35px; left: 7px; width: 168px; height: 112px;">
		        <img  src="http://redvixen-studios.com/galleries/test-album/thumbnails/emw_20170218_165247_Planes_0034.jpg" id="photo-emw_20170218_165247_Planes_0034" height="112" width="168" style="height: 112px; width: 168px;" alt="emw_20170218_165247_Planes_0034.jpg" title="emw_20170218_165247_Planes_0034.jpg"

 data-metadata-title-1="Date/Time" data-metadata-value-1="18 Feb 2017 16:52:47" data-metadata-title-2="Lens" data-metadata-value-2="300 mm f/4" data-metadata-title-3="Shutter speed /  Aperture" data-metadata-value-3="1/320 sec at f/9.0" data-metadata-title-4="ISO Speed Rating" data-metadata-value-4="800" data-metadata-title-5="Exposure Bias" data-metadata-value-5="0 EV" data-metadata-title-6="Flash" data-metadata-value-6="no flash"
		        />
		      </a>

					<button class="gridicon crg-select select-emw_20170218_165247_Planes_0034 off"></button><button class="gridicon crg-feedback feedback-emw_20170218_165247_Planes_0034" data-mfp-src="#crg-modal"></button>
					
										<a class="gridicon download" href=""><span>Download</span></a>					

	    	</div>
	      <figcaption itemprop="caption description"></figcaption>
	
		      <ul class="metadata">
	         
	        <li>emw_20170218_165247_Planes_0034</li> 
	      </ul>
		
	    </figure>

Offline

#6 2017-02-28 19:28:55

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: Client Response Add-On Questions...

You are sure you switched the Metadata items from the default OFF to ON? You need to set them ON, then also set title and tokens. So it's three settings you need in the template.


Matt

The Turning Gate, http://theturninggate.net

Offline

#7 2017-03-01 03:27:15

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Re: Client Response Add-On Questions...

All metadata items selected ON visually verified in the CRG configuration UI and also in the JSON for the exported template (the relevant bits are reproduced below):

"crg.metadata.meta01.title":"Date\/Time","crg.metadata.meta01.value":"{DD} {Mon} {YYYY} {HH}:{MIN}:{SS}",
"crg.metadata.meta02.title":"Lens","crg.metadata.meta02.value":"{Lens}",
"crg.metadata.meta03.title":"Shutter speed \/  Aperture","crg.metadata.meta03.value":"{ShutterSpeed} at {Aperture}",
"crg.metadata.meta04.title":"ISO Speed Rating","crg.metadata.meta04.value":"{ISO}",
"crg.metadata.meta05.title":"Exposure Bias","crg.metadata.meta05.value":"{ExposureBias}",
"crg.metadata.meta06.title":"Flash","crg.metadata.meta06.value":"{Flash}"

"crg.select":"on",
"crg.feedback":"on",
"crg.metadata.meta01":"on",
"crg.metadata.meta02":"on",
"crg.metadata.meta03":"on",
"crg.metadata.meta04":"on",
"crg.metadata.meta05":"on",
"crg.metadata.meta06":"on"

Digging into the code in file jquery.ttgcrg-backlight.js, I found this loop at line 224 that renders the metadata deflist items in the modal popup:

		for (count = 1; count < 5; count++) {
			var title = $(img).attr('data-metadata-title-' + count);
			var value = $(img).attr('data-metadata-value-' + count);

			if (title != undefined && value != undefined) {
				$('div.crg-metadata').append('<dl><dt>' + title + '</dt><dd>' + value + '</dd></dl>');
			}
		}

That loop will terminate after four iterations...when the 5 is changed to a 7, all six of the available metadata items appear in the modal popup if they're turned on in the template.  I tested this by quickly patching that file on my site and it seems to work with no knock-on ill effects.

Offline

#8 2017-03-01 15:46:23

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: Client Response Add-On Questions...

Hurray for bugs! Good find. I'll update our working code so that the fix will roll out in our next update. Also, thanks for hanging in through my trying to eliminate user-error as cause.


Matt

The Turning Gate, http://theturninggate.net

Offline

#9 2017-03-01 22:05:36

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Re: Client Response Add-On Questions...

No worries...truth be told, not being at the latest version *WAS* user error!  And I suspect there will be plenty of times in the future that there will be more opportunities for user error on my part as I start bringing the cart online and perhaps consider integrating with FotoMoto and/or PayPal so don't put away that hammer to bonk me on the head when I'm being an idiot just yet...  wink

FWIW, I was a beta-tester as my first job after university many moons ago before moving into the programming side of things and so have always been in favour of rock-solid steps to reproduce and proving a bug exists.  I'm sure it annoyed the bejeebers out of some of the programmers I worked for with this tendency to approach these situations like a prosecutor building a slam-dunk case in court. 

But that experience of having to test applications turned out to be the most valuable experience I ever had because as programmers, we have a natural tendency to trust in our code until proven otherwise.  The hardest thing in programming for me through the years is to try to force myself to step back and work through the "simple" solutions first before assuming something really nasty is going on like the database is crocked or extraordinary solar flare activity or my users have turned off their foot warmers, etc.  smile

Offline

Board footer

Powered by FluxBB