I had a view on the home page of my website that was displaying about 8 pages set on an automatic AJAX advance every 10 seconds, with pagination controls at the bottom. I added a link (as a button) to the view and now only the first page is viewing, it's not auto-advancing, and there are no pagination controls. I deleted the button and reverted back but it still isn't working. I also set the limit to 2 pages instead of 1 and it successfully displays two but when going back to 1 it still does not act as if there are any other posts to display. I've attached some screenshots to help. I must be doing something dumb, right? I just can't figure out what it is. This should be an easy one, sorry. Thanks for any help.
- Aaron
Not sure about this one, the View looks okay. Can you enable debug mode in Toolset > Settings > Frontend Content and test again? I'm not sure how to access this page when logged in, so I wasn't able to test it myself. If you're able to get the debug panel open, toggle all the sections open and copy + paste the results here for me to review.
Having trouble getting the debug mode to work. I ticked the box that enables it and added my website to the list of exceptions to popup blocking, but nothing happens.
The best way to test while logged in is to just have two browsers open - one logged in and one not. The website automatically redirects you a different page if you're logged in.
Also, since the site is live I'm hesitant to leave debug mode on for very long, FYI.
- Aaron
Right, the problem is that debug mode only works for logged-in Users. It's not meant to be shown to guests, so I'm not sure how to get it to show up on this login page. As an alternative, you could take this View and place it somewhere else on the site that a logged-in User can access.
Good idea - I put the view onto the following logged-in page: enlace oculto
Attached are screenshots from the debug.
Does debug mode put that popup window for all logged-in users or just admins? If the former and you want to test yourself, just be sure to only turn it on long enough to refresh the page. Thanks.
- Aaron
Okay I thought maybe this View had become corrupted somehow, so I recreated it from scratch: enlace oculto
I added that View to the test page and it has the same problem - no automatic advance. So I was digging deeper and I found something strange in the View's Loop Output. Check this screenshot. Any idea why this form tag would be appearing here? I replaced my test View with the original View and found the same issue. Neither View's loop contains this Form tag. It's not in the page source, so that indicates it's injected with JavaScript somehow. I wasn't able to pin it down quickly and wondered if this was something you recognized.
Interesting - The only custom JS code I've added related to maps is pasted below, but it's only set to update certain form fields if they exist, and it's only triggered when a Google Map call is made. I also wouldn't have named a form ID by that. Usually when I've been making custom things I've started with the prefix "be_" and I wouldn't have manually tried to force anything with a toolset name. Maybe because that form has no closing tag is why it's fouling up the view output.
Could the following line be causing the form to get created?
$("input.js-toolset-google-map").on( "geocode:result", function( event, result ){
( function( $ ) {
$( document ).ready( function(){
$("input.js-toolset-google-map").on( "geocode:result", function( event, result ){
var addressComponents = result.address_components;
var coordinates = result.geometry.location.lat() + ', ' + result.geometry.location.lng();
x = document.getElementsByClassName("be_geo_coordinates");
y = x[0].id;
document.getElementById(y).value = coordinates;
var targetDate = new Date();
var timestamp = targetDate.getTime()/1000*60
var apikey = '***';
var apicall = '<em><u>enlace oculto</u></em>' + coordinates + '×tamp=' + timestamp + '&key=' + apikey;
var xhr = new XMLHttpRequest() // create new XMLHttpRequest2 object
xhr.open('GET', apicall) // open GET request
xhr.onload = function(){
if (xhr.status === 200){ // if Ajax request successful
var output = JSON.parse(xhr.responseText) // convert returned JSON string to JSON object
console.log(output.status) // log API return status for debugging purposes
if (output.status == 'OK'){ // if API reports everything was returned successfully
console.log(output)
x = document.getElementsByClassName("be_geo_timezone_id");
y = x[0].id;
document.getElementById(y).value = output.timeZoneId;
x = document.getElementsByClassName("be_geo_timezone_name");
y = x[0].id;
document.getElementById(y).value = output.timeZoneName;
document.getElementById('be_geo_timezone_name_label').innerHTML = output.timeZoneName;
}
}
else{
alert('Request failed. Returned status of ' + xhr.status)
}
}
xhr.send() // send request
$.each( addressComponents, function( index, value ){
if ( addressComponents[ index ].types[0] == "street_number" ) {
var element_value = addressComponents[ index ].long_name;
x = document.getElementsByClassName("be_geo_house");
y = x[0].id;
document.getElementById(y).value = element_value;
} else if ( addressComponents[ index ].types[0] == "route" ) {
var element_value = addressComponents[ index ].long_name;
x = document.getElementsByClassName("be_geo_street");
y = x[0].id;
document.getElementById(y).value = element_value;
} else if ( addressComponents[ index ].types[0] == "locality" ) {
var element_value = addressComponents[ index ].long_name;
x = document.getElementsByClassName("be_geo_city");
y = x[0].id;
document.getElementById(y).value = element_value;
} else if ( addressComponents[ index ].types[0] == "administrative_area_level_1" ) {
var element_value = addressComponents[ index ].short_name;
x = document.getElementsByClassName("be_geo_state");
y = x[0].id;
document.getElementById(y).value = element_value;
} else if ( addressComponents[ index ].types[0] == "postal_code" ) {
var element_value = addressComponents[ index ].short_name;
x = document.getElementsByClassName("be_geo_postalcode");
y = x[0].id;
document.getElementById(y).value = element_value;
} else if ( addressComponents[ index ].types[0] == "country" ) {
var element_value = addressComponents[ index ].short_name;
x = document.getElementsByClassName("be_geo_country");
y = x[0].id;
document.getElementById(y).value = element_value;
}
} );
} );
} );
})( jQuery );
Okay no, this isn't causing the form tag and I'm seeing it injected in other Views on my local site so it must be injected by the Maps plugin for a reason I'm not aware of. I think the next step is an isolation test, deactivate plugins except for Toolset and activate a default theme, then test again. If you have a test environment set up I can do that, or I will need a new clone of your site to test locally. I'm not able to recreate the issue on the old copy I already have access to. Let me know how you want to proceed.
Hi Christian,
Shutting off plugins is going to be difficult because the site has been launched. Although I'm not getting much traffic, I never know when somebody is going to connect. Should I make a new duplicator package?
- Aaron
A new duplicator package will be fine. First, please make sure you're up-to-date on Maps and all the other Toolset plugins. I just found out today there was a bug in Maps 1.5 that caused problems with pagination in some Views, and I'd like to confirm this isn't also responsible for your issue. If not, please provide a new package download link here in the private fields.
Also - confirmed the issue is still present despite this morning's upgrade to the newest versions of each plugin.
Okay thanks I have the Duplicator package now, I'll run some additional tests and update you soon.
Test page is working now on the live site! Maybe there was a cached file causing a problem. It's advancing correctly for me. Can you clear cache and check again?
You're right! It looks like it's working on the front page, too. I didn't realize because the pagination controls aren't showing up. I'll look into that now to make sure we didn't remove them while troubleshooting. Maybe it was that bug that got fixed after all.
- Aaron
I confirmed the pagination control is now working as well - it had been removed while troubleshooting. Unless you did anything differently, I think it must have been that bug you mentioned coming from Maps. The issue seems to be fully resolved now. Thanks for the help.
- Aaron