Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem on admin/media.php #20

Closed
link0087 opened this issue Oct 15, 2014 · 3 comments
Closed

Problem on admin/media.php #20

link0087 opened this issue Oct 15, 2014 · 3 comments

Comments

@link0087
Copy link
Contributor

Hello,

i would like to introduce a little doubt that i have on this plugin, in particular on the media.php file.
I have WP Plugin version 3.0, on method "a_get_list" there is a problem on the return json.
on the if ( isset( $_POST['post_types'] ) && !empty( $_POST['post_types'] ) ) , so if i specified some post type on the regeneration screen to intend, the query in this piece of code, return a count of id:

$attachments = $wpdb->get_var( "SELECT count(ID)
FROM $wpdb->posts
WHERE 1 = 1
AND post_type = 'attachment'
$whichmimetype
AND
(post_parent = 0
OR
post_parent IN (
SELECT DISTINCT ID
FROM $wpdb->posts
WHERE post_type IN ('".implode( "', '", $_POST['post_types'] )."')
)) " );

this seems correct but is not compatible with the return code:

SIS_Admin_Main::displayJson( array( 'total' => count( $attachments ) ) );

in this case the plugin failed, because of a count of a count that is still "1".

i hope to be clear on this mail not easy to explaine for me in english :)

Please feel free to reply me back if you need more information.

Thank you so much

Fabio Sirchia

@Rahe
Copy link
Owner

Rahe commented Oct 15, 2014

hi !
Thank you for the feedback, effectively this will not work :/
If you want you can make a pull request and I will accept it :).

This will be merged on the next version of the plugin.
Thank you !

@link0087
Copy link
Contributor Author

Sent the pull request all yours :)

@Rahe
Copy link
Owner

Rahe commented Oct 15, 2014

Pull request merged, thank you !

@Rahe Rahe closed this as completed Oct 15, 2014
Rahe added a commit that referenced this issue Oct 15, 2014
* Change the template render method for non apache webservers : https://wordpress.org/support/topic/fatal-error-1190?replies=6
	* Remove ambigious ids for the css bugging WooCommerce : https://wordpress.org/support/topic/bad-css-style-administration and
	* Right code for counting the elements on backoffice  : #20
	* Fix bug on regenation and _e instead of __ : https://plugins.trac.wordpress.org/ticket/2259
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants