Skip Navigation

[Resolved] New listings not showing in alpha listing

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 22 replies, has 2 voices.

Last updated by Minesh 1 year, 2 months ago.

Assisted by: Minesh.

Author
Posts
#2558475

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

With regard to the following reply:
- https://toolset.com/forums/topic/new-listings-not-showing-in-alpha-listing/#post-2558335
==>
It seems you have added the new post with your live site. I'm bit confuse now what issue we have to solve first.

The staging site you shared with us is terribly slow and I could not work on that as its too slow.

Can we please go step by step and resolve the issue. What issue you want to resolve first?

#2558631

Hello,

Thanks for the reply.

The live site is the one we are needing to resolve the issues on.

I have highlighted the issue in my previous reply. I tried adding multiple post items and the issue boiled down to the letter 'q' in the post title as the second character.

I don't know how much more information I need to provide. My currently used views and WordPress archive information have been provided.

Cheers,

#2558681

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Just to ensure again you want help with the following issue:
- https://toolset.com/forums/topic/new-listings-not-showing-in-alpha-listing/page/2/#post-2558337

Correct? If yes:
I will require live site access details as with the staging site I do not see the following page:
- hidden link

Is the above page is available with the staging site - if yes, can you please share link of that.

I have set the next reply to private which means only you and I have access to it.

#2558691

Hello,

You are not understanding what I have said. The issue is not with posts that start with 'q', but have 'q' as the second character in the word. The post Aqua Alta should be available under 'A' in the alpha listing, but it is not showing because the 'q' character is conflicting with the Toolset code for some reason.

You can see the affected page here: hidden link

The staging site is no longer applicable to this issues.

The code to manage the display of the alpha listing glossary is included below. I am not sure if it would be conflicting with the 'q' issue or not.

add_filter('wpv_filter_query', 'by_first_letter_digit_glossary', 10, 3);
function by_first_letter_digit_glossary($query, $setting, $view_id) {
  global $wpdb;
  if($setting['view_id'] == 5673) {
    if(isset($_GET['wpvalphabet']) and $_GET['wpvalphabet'] != '' ) {
      $first_char = $_GET['wpvalphabet'];
      if($first_char == '0-9') {
        $postids = $wpdb->get_col($wpdb->prepare(
          "SELECT ID
          FROM $wpdb->posts
          WHERE $wpdb->posts.post_title REGEXP '^[0-9]' 
            AND post_type = '".$query['post_type'][0]."'
            AND post_status = 'publish'
          ORDER BY $wpdb->posts.post_title")); 
      } else {
        $postids = $wpdb->get_col($wpdb->prepare(
          "SELECT ID
          FROM $wpdb->posts
          WHERE SUBSTR($wpdb->posts.post_title,1,1) = %s
            AND post_type = '".$query['post_type'][0]."'
            AND post_status = 'publish'
          ORDER BY $wpdb->posts.post_title",$first_char)); 
      }
      $query['post__in'] = $postids;
    }
  }
  return $query;
}

Cheers,

#2558775

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - so if you do not want me to dive into the live site and even we do not recommend that as well.

To debug this issue I will require duplicator copy of your site.

Can you please send me duplicator copy of your live site:
- https://toolset.com/faq/provide-supporters-copy-site/

I have set the next reply to private which means only you and I have access to it.

#2558917

Hello,

I am starting to believe your plugin is severely broken. It is now causing critical errors within the WordPress admin without me even touching anything.

When I try to edit a page post type that has the Toolset created archive embedded on it, the following error is sent by WordPress.

Error Details
=============
An error of type E_ERROR was caused in line 3448 of the file /var/www/flagstaff.ab.ca/wp-content/plugins/toolset-blocks/embedded/inc/wpv.class.php. Error message: Uncaught TypeError: Unsupported operand types: int / string in /var/www/flagstaff.ab.ca/wp-content/plugins/toolset-blocks/embedded/inc/wpv.class.php:3448
Stack trace:
#0 /var/www/flagstaff.ab.ca/wp-content/plugins/toolset-blocks/embedded/inc/wpv.class.php(2526): WP_Views->taxonomy_query()
#1 /var/www/flagstaff.ab.ca/wp-content/plugins/toolset-blocks/embedded/inc/wpv.class.php(2137): WP_Views->render_view()
#2 /var/www/flagstaff.ab.ca/wp-content/plugins/toolset-blocks/embedded/inc/wpv.class.php(646): WP_Views->render_view_ex()
#3 /var/www/flagstaff.ab.ca/wp-includes/shortcodes.php(355): WP_Views->short_tag_wpv_view()
#4 [internal function]: do_shortcode_tag()
#5 /var/www/flagstaff.ab.ca/wp-includes/shortcodes.php(227): preg_replace_callback()
#6 /var/www/flagstaff.ab.ca/wp-content/plugins/toolset-blocks/embedded/inc/wpv-shortcodes.php(2594): do_shortcode()
#7 /var/www/flagstaff.ab.ca/wp-content/plugins/toolset-blocks/embedded/inc/wpv.class.php(2179): wpv_do_shortcode()
#8 /var/www/flagstaff.ab.ca/wp-content/plugins/toolset-blocks/embedded/inc/wpv.class.php(646): WP_Views->render_view_ex()
#9 /var/www/flagstaff.ab.ca/wp-includes/shortcodes.php(355): WP_Views->short_tag_wpv_view()
#10 [internal function]: do_shortcode_tag()
#11 /var/www/flagstaff.ab.ca/wp-includes/shortcodes.php(227): preg_replace_callback()
#12 /var/www/flagstaff.ab.ca/wp-includes/class-wp-hook.php(308): do_shortcode()
#13 /var/www/flagstaff.ab.ca/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#14 /var/www/flagstaff.ab.ca/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(1857): apply_filters()
#15 /var/www/flagstaff.ab.ca/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(568): WP_REST_Posts_Controller->prepare_item_for_response()
#16 /var/www/flagstaff.ab.ca/wp-includes/rest-api/class-wp-rest-server.php(1171): WP_REST_Posts_Controller->get_item()
#17 /var/www/flagstaff.ab.ca/wp-includes/rest-api/class-wp-rest-server.php(1018): WP_REST_Server->respond_to_request()
#18 /var/www/flagstaff.ab.ca/wp-includes/rest-api.php(535): WP_REST_Server->dispatch()
#19 /var/www/flagstaff.ab.ca/wp-includes/rest-api.php(2884): rest_do_request()
#20 [internal function]: rest_preload_api_request()
#21 /var/www/flagstaff.ab.ca/wp-includes/block-editor.php(638): array_reduce()
#22 /var/www/flagstaff.ab.ca/wp-admin/edit-form-blocks.php(77): block_editor_rest_api_preload()
#23 /var/www/flagstaff.ab.ca/wp-admin/post.php(187): require('...')
#24 {main}
thrown

Please advise.

Cheers,

#2559181

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I can not say anything until I review and debug the things and that is why I asked you to share the duplicator copy of your live site and also share the steps I should follow to see the above issue you shared.

Can you please send me duplicator copy of your live site:
- https://toolset.com/faq/provide-supporters-copy-site/

#2560151

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Regarding the code you shared with the following reply:
- https://toolset.com/forums/topic/new-listings-not-showing-in-alpha-listing/page/2/#post-2558691\

The code shared using the "wpv_filter_query" hook is meant to fetch only posts that starts with the first character that you selected to be filter with. For instance - if you selected the Q it will display the only posts whose title starts with capital Q.
- hidden link

To overcome this limitation - I've adjusted the code as given under. You can just comment out existing code and add the following code:

add_filter('wpv_filter_query', 'by_first_letter_digit_glossary', 99, 3);
function by_first_letter_digit_glossary($query, $setting, $view_id) {
  global $wpdb;
  if($setting['view_id'] == 5673) {
    if(isset($_GET['wpvalphabet']) and $_GET['wpvalphabet'] != '' ) {
      $first_char = $_GET['wpvalphabet'];
	  
	
      if($first_char == '0-9') {
        $postids = $wpdb->get_col($wpdb->prepare(
          "SELECT ID
          FROM $wpdb->posts
          WHERE $wpdb->posts.post_title REGEXP '^[0-9]' 
            AND post_type = '".$query['post_type'][0]."'
            AND post_status = 'publish'
          ORDER BY $wpdb->posts.post_title")); 
      } else {
        $postids = $wpdb->get_col($wpdb->prepare(
          "SELECT ID
          FROM $wpdb->posts
          WHERE SUBSTR($wpdb->posts.post_title,1,1) = %s or $wpdb->posts.post_title LIKE %s
            AND post_type = '".$query['post_type'][0]."'
            AND post_status = 'publish'
          ORDER BY $wpdb->posts.post_title",$first_char,'%'.strtolower($first_char).'%')); 
      }
	  
		  
      $query['post__in'] = $postids;
    }
  }
  return $query;
}

The above code will help you to search the posts whose post title will starts with the selected letter as well as it will also search for the posts whose post title having the selected letter available in-between(within) the post title .

Also I checked the view:
- hidden link

the above view is set to display only 20 posts with section "Limit and Offset" - you can change it to no limit so you can see all posts that are found.

Regarding the another problem you mentioned with the following reply:
- https://toolset.com/forums/topic/new-listings-not-showing-in-alpha-listing/page/2/#post-2558917
Can you please share steps I will have to follow or link (URL) where I can see that issue.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.