Project

General

Profile

Bug #7838

sqlValidate does not work with inner query

Added by Nicola Chiapolini over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
Start date:
07.02.2019
Due date:
% Done:

0%

Estimated time:
Discuss:

Description

QFQ-Version: 19.01.1

I do have a beforeSave element with the following validation setup:

sqlValidate={{!SELECT id FROM `phd_milestone_subrecords` WHERE milestone_id='{{id:R0}}' LIMIT {{SELECT subrecords FROM _milestone_types WHERE id='{{type:R0}}' }} }}
expectRecords = {{SELECT subrecords FROM _milestone_types WHERE id='{{type:R0}}' }}
messageFail = Wrong number of entries.

This does not raise the error even if the needed number of subrecords are missing. When replacing the inner query with 1 everything works.
Other places where I use inner queries seem to work correctly.

The problem can be avoided with:

sqlValidate={{!SELECT id FROM `phd_milestone_subrecords` WHERE milestone_id='{{id:R0}}' }}
expectRecords = {{SELECT GROUP_CONCAT(seq) FROM (SELECT seq FROM seq_0_to_30) AS positions WHERE seq >= (SELECT subrecords FROM _milestone_types WHERE id='{{type:R0}}') }}
messageFail = Wrong number of entries.

I have not investigated this much further, but am happy to create a Minimal Not-Working Example if needed :-)


Related issues

Related to QFQ - Support #9074: fillStoreVar: seems not to parse nested QFQ queryClosedCarsten Rose09.09.201909.09.2019

Actions

Also available in: Atom PDF