I installed DEVEL in order to generate nodes, comemnts etc for my development purposes.
Now I tried to delete all the nodes etc and I got the following error:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1: SELECT n.nid AS nid FROM {node} n WHERE (type IN ()) ; Array ( ) in devel_generate_content_kill() (line 635 of /web/htdocs/www.mysite.org/home/drupal/sites/all/modules/devel/devel_generate/devel_generate.inc).

Could you help me please?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

HyperD’s picture

Solved. It's necessary to select all the material I want to delete, then the select-box delete all, then put 0 where is wirtten, how many posts would you like to generate.

salvis’s picture

Component: devel » devel_generate
Category: support » bug
Priority: Critical » Normal

Thanks for following up.

Seems like we need some input validation here.

amitgoyal’s picture

Somehow I am not able to reproduce this issue. Steps?

HyperD’s picture

I just selected "delete all" avoiding to select waht are the content types in which the program should delete the content

amitgoyal’s picture

@TizianoD - I also just selected "Delete all content" on Generate content (admin/config/development/generate/content) page but not getting any error or message. It comes back to the same page when I click Generate button without any error / message.

I have taken latest version of Devel from git repo and using Drupal 7.15. I also tried other permutations and combinations but no such error. Can you please cross check with latest code of Devel module?

HyperD’s picture

As I said opening the issue here: version 7-1.3 of Devel and Drupal 7.15.

amitgoyal’s picture

Status: Active » Needs review
FileSize
790 bytes

Thanks for clarifying this @TizianoD. I am to reproduce this issue in Devel's 7.x-1.3 version.

Here is the patch to fix this issue. Basically I have added a validation hook to make sure that user select atleast one node type for which he wants to delete the content.

moshe weitzman’s picture

Looks good. Does Drush need enhancing as well?

pcambra’s picture

Version: 7.x-1.3 » 8.x-1.x-dev

Looks good for me too, I was going to patch something similar.

We need to do this first in D8, but probably this patch would apply just fine.

salvis’s picture

#7: sql_error-1792854-7.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, sql_error-1792854-7.patch, failed testing.

pcambra’s picture

whaat?
exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupaltestbotmysql.simpletest608385system' doesn't exist' in /var/lib/drupaltestbot/sites/default/files/checkout/core/lib/Drupal/Core/Database/Statement.php:58

Queueing it again

pcambra’s picture

Status: Needs work » Needs review

#7: sql_error-1792854-7.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, sql_error-1792854-7.patch, failed testing.

amitgoyal’s picture

Version: 8.x-1.x-dev » 7.x-1.3
Status: Needs work » Needs review
FileSize
1.82 KB

@moshe - Yes drush also requires the similar fix. Attaching here updated patch which will fix the error in drush command.

@pcambra - There is no such error in D8 on the admin interface. Secondly it looks like automated testing error "Base table or view not found: 1146 Table 'drupaltestbotmysql.simpletest608385system' doesn't exist" is not due to devel module,

Please review and let me know if any changes are required.

sanchi.girotra’s picture

Status: Needs review » Reviewed & tested by the community

I am able to apply this patch successfully in 7.x-1.3 branch and it works fine for me.

pcambra’s picture

Status: Reviewed & tested by the community » Fixed

Tested this and changed it slightly to use form_set_values.
Also removed the set error element as it is a table and it won't display in some cases and changed form_id by form.

Also I think it'd be good to add this validation to D8 even if this is not throwing an error there.

Committed, thanks all!

moshe weitzman’s picture

I don't see any answer to my question about whether drush integration needs validation as well

amitgoyal’s picture

@moshe - Please see #15.

I have mentioned that drush integration needs validation and updated the patch accordingly.

moshe weitzman’s picture

Thanks amitgoyal. Sorry I missed that comment.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.