Title: [Plugin: Basic Google Maps Placemarks] Sortable columns broken
Last modified: August 20, 2016

---

# [Plugin: Basic Google Maps Placemarks] Sortable columns broken

 *  [volfro](https://wordpress.org/support/users/volfro/)
 * (@volfro)
 * [14 years ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-sortable-columns-broken/)
 * Just a note: column sorting from the admin seems to be broken.
 * In order to get some [custom (sortable) columns](http://pastebin.com/z5VntCai)
   to actually sort properly, I had to comment out lines 115 and 1091-1131 in core.
   php.
 * As it stands, the existing code seems to break even sorting by title. Commenting
   those lines out fixed the title sorting, even without the code linked above.
 * [http://wordpress.org/extend/plugins/basic-google-maps-placemarks/](http://wordpress.org/extend/plugins/basic-google-maps-placemarks/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Ian Dunn](https://wordpress.org/support/users/iandunn/)
 * (@iandunn)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-sortable-columns-broken/#post-2777672)
 * Thanks for letting me know. I’ll fix that in an upcoming release, probably v1.8.1.
 * What version of the plugin are you using? core.php in version 1.7 only has 1,083
   lines, and line 115 is just grabbing an option from the database. If you’ve modified
   core.php then your line numbers will probably be different than the original 
   ones. Can you paste the code that you commented out?
 *  Thread Starter [volfro](https://wordpress.org/support/users/volfro/)
 * (@volfro)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-sortable-columns-broken/#post-2777726)
 * V.1.7
 * Oh, strange, there’s a carriage return between every line. Doubles the length
   of the file. I’ve seen this happen to plug-ins and themes before.
 * The real line numbers are lines 58:
    `add_filter( 'parse_query', array( $this,'
   sortAdminView' ) );` and 546-561:
 *     ```
       /**
       		 * Sorts the posts by the title in the admin view posts screen
       		 * @author Ian Dunn <ian@iandunn.name>
       		 */
       		function sortAdminView( $query )
       		{
       			global $pagenow;
   
       			if( is_admin() && $pagenow == 'edit.php' && array_key_exists( 'post_type', $_GET ) && $_GET[ 'post_type' ] == self::POST_TYPE )
       			{
       				$query->query_vars['order'] = apply_filters( self::PREFIX . 'admin-sort-order', 'ASC' );
       				$query->query_vars['orderby'] = apply_filters( self::PREFIX . 'admin-sort-orderby', 'title' );
   
       				// @todo - should just have a filter on $query, or don't even need one at all, since they can filter $query directly?
       			}
       		}
       ```
   
 *  Plugin Author [Ian Dunn](https://wordpress.org/support/users/iandunn/)
 * (@iandunn)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-sortable-columns-broken/#post-2777731)
 * Yeah, [different operating systems use different end-of-line formats](http://en.wikipedia.org/wiki/Newline),
   and many text editors don’t handle it gracefully.
 * Thanks for posting the code, that makes much more sense now. I’ve added it to
   my TODO list.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Basic Google Maps Placemarks] Sortable columns broken’ is closed
to new replies.

 * ![](https://ps.w.org/basic-google-maps-placemarks/assets/icon-128x128.png?rev
   =1152531)
 * [Basic Google Maps Placemarks](https://wordpress.org/plugins/basic-google-maps-placemarks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/basic-google-maps-placemarks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/basic-google-maps-placemarks/)
 * [Active Topics](https://wordpress.org/support/plugin/basic-google-maps-placemarks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/basic-google-maps-placemarks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/basic-google-maps-placemarks/reviews/)

## Tags

 * [admin](https://wordpress.org/support/topic-tag/admin/)
 * [sorting](https://wordpress.org/support/topic-tag/sorting/)

 * 3 replies
 * 2 participants
 * Last reply from: [Ian Dunn](https://wordpress.org/support/users/iandunn/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-basic-google-maps-placemarks-sortable-columns-broken/#post-2777731)
 * Status: not resolved