Skip to content

Fix "field" action - return all records, allow Action as scope condition#861

Merged
mvorisek merged 3 commits intodevelopfrom
fix_field_action
Apr 24, 2021
Merged

Fix "field" action - return all records, allow Action as scope condition#861
mvorisek merged 3 commits intodevelopfrom
fix_field_action

Conversation

@mvorisek
Copy link
Copy Markdown
Member

@mvorisek mvorisek commented Apr 22, 2021

merge after #860

also fixes array persistence tryLoad which previously was completely ignoring all conditions (they were used only when loading data using iterator)

@mvorisek
Copy link
Copy Markdown
Member Author

mvorisek commented Apr 23, 2021

@georgehristov can you please review?

Do you know why 7d598f1#diff-facfb8206c512f6ada3a34d73c4ed464957c84987a77f986e2b8357bca34ab29R205 is needed to NOT check keys? The scope is for refId but the data have id keys. Are (our/their) column names/aliases set correctly in HasMany class?

@mvorisek mvorisek requested a review from abbadon1334 April 23, 2021 08:19
@mvorisek mvorisek force-pushed the fix_field_action branch 3 times, most recently from f99fa4c to 89912a6 Compare April 23, 2021 08:36
if ($id === self::ID_LOAD_ONE || $id === self::ID_LOAD_ANY) {
if (count($this->data[$model->table]) === 0) {
$action = $this->action($model, 'select');
$action->generator->rewind(); // needed for some reasons!
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed, should this be done in the action itself?

@mvorisek mvorisek changed the title Fix "field" action - all records, allow Action as scope condition Fix "field" action - return all records, allow Action as scope condition Apr 23, 2021
Copy link
Copy Markdown
Member

@DarkSide666 DarkSide666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but would be good if @georgehristov could take a look too

@mvorisek mvorisek merged commit 9b69ce0 into develop Apr 24, 2021
@mvorisek mvorisek deleted the fix_field_action branch April 24, 2021 07:14
@mvorisek mvorisek added the RTM label Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants