soflyy / breakdance-bugs

Bug reports from Breakdance users.
40 stars 6 forks source link

Error while searching and filtering form submissions #971

Closed mirkoschubert closed 1 month ago

mirkoschubert commented 10 months ago

There is a database error if you search for an entry while filtering a form in the form submissions.

Steps for reproduction:

  1. Create multiple forms with the Breakdance form builder
  2. Get form submissions for all forms.
  3. Go to Breakdance -> Form Submissions
  4. Select a form and press Filter
  5. Type anything in the search field and press Search
  6. Instead of seeing the entries for your search term from the selected form, you get a database error:
[Not unique table/alias: 'ndp_postmeta']
SELECT SQL_CALC_FOUND_ROWS DISTINCT ndp_posts.ID FROM ndp_posts INNER JOIN ndp_postmeta ON ( ndp_posts.ID = ndp_postmeta.post_id ) INNER JOIN ndp_postmeta AS mt1 ON ( ndp_posts.ID = mt1.post_id )LEFT JOIN ndp_postmeta ON ndp_posts.ID = ndp_postmeta.post_id WHERE 1=1 AND (((ndp_posts.post_title LIKE '%krueger%') OR (ndp_postmeta.meta_value LIKE '%krueger%') OR (ndp_posts.post_excerpt LIKE '%krueger%') OR (ndp_posts.post_content LIKE '%krueger%'))) AND ( ( ( ndp_postmeta.meta_key = '_breakdance_post_id' AND ndp_postmeta.meta_value = '216' ) AND ( mt1.meta_key = '_breakdance_form_id' AND mt1.meta_value = '146' ) ) ) AND ((ndp_posts.post_type = 'breakdance_form_res' AND (ndp_posts.post_status = 'publish' OR ndp_posts.post_status = 'unread' OR ndp_posts.post_status = 'read' OR ndp_posts.post_status = 'future' OR ndp_posts.post_status = 'draft' OR ndp_posts.post_status = 'pending' OR ndp_posts.post_status = 'private'))) GROUP BY ndp_posts.ID ORDER BY ndp_posts.post_title LIKE '%krueger%' DESC, ndp_posts.post_date DESC LIMIT 0, 200

Even if the search term and filter would match you get no results in the submissions table. But if you search for a term without filtering the forms it works normally and you get all the results.

Config details:

breakdancemoderator commented 1 month ago

Thanks for the report. This has been addressed in Breakdance 2.0.