Problem/Motivation
Enabling aggregation can cause SQL errors. This happens when a fields that has multiple columns (like an image field) has been added to to the View. Views currently sets no default column for such fields and it has no fall back or catch for fields that have no group_column set.
Reproduction Instructions
(From #8)
- Create new view for article or basic page
- Add fields title, body and image
- Enable views aggregation
Proposed resolution
Fix the field query so that this problem does not occur by adding better settings of defaults and adding a fall back for empty values.
Remaining tasks
Write patch to fix the errorManual testing of patchWrite automated test(s)- Manual review of code
User interface changes
No UI changes.
API changes
No API changes.
Data model changes
No data model changes.
Original Bug Report
Created a view using content of type officers. Using taxonomy to designate a position for each officer. That field is set to unlimited.
The content title field is being used for the officer name, and there is a link field, which provides a link to each officer's contact form, each of which were created under Structure > Contact Form.
The Contact form link field is hidden in the view, and the title field is rewritten so that it displays the officer's name with a link to the contact form.
One officer has two positions, so I added the two positions to that particular officer's content item. The entry for the officer with two positions appeared twice in the view, so I turned aggregation to 'on,' which I understand it the tool to handle these types of situations.
I received the following error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node__field_officer_contact_form.field_officer_contact_form_' in 'field list': SELECT node__field_officer_contact_form.field_officer_contact_form_ AS node__field_officer_contact_form_field_officer_contact_form_, node_field_data.title AS node_field_data_title, node__field_officer_position.field_officer_position_target_id AS node__field_officer_position_field_officer_position_target_i, taxonomy_term_field_data_node__field_officer_position.weight AS taxonomy_term_field_data_node__field_officer_position_weight, MIN(node_field_data.nid) AS nid, MIN(taxonomy_term_field_data_node__field_officer_position.tid) AS taxonomy_term_field_data_node__field_officer_position_tid FROM {node_field_data} node_field_data LEFT JOIN {node__field_officer_position} node__field_officer_position ON node_field_data.nid = node__field_officer_position.entity_id AND (node__field_officer_position.deleted = :views_join_condition_0 AND node__field_officer_position.langcode = node_field_data.langcode) INNER JOIN {taxonomy_term_field_data} taxonomy_term_field_data_node__field_officer_position ON node__field_officer_position.field_officer_position_target_id = taxonomy_term_field_data_node__field_officer_position.tid LEFT JOIN {node__field_officer_contact_form} node__field_officer_contact_form ON node_field_data.nid = node__field_officer_contact_form.entity_id AND (node__field_officer_contact_form.deleted = :views_join_condition_2 AND node__field_officer_contact_form.langcode = node_field_data.langcode) WHERE (( (node_field_data.status = :db_condition_placeholder_4) AND (node_field_data.type IN (:db_condition_placeholder_5)) )) GROUP BY node__field_officer_contact_form_field_officer_contact_form_, node_field_data_title, node__field_officer_position_field_officer_position_target_i, taxonomy_term_field_data_node__field_officer_position_weight ORDER BY taxonomy_term_field_data_node__field_officer_position_weight ASC; Array ( [:db_condition_placeholder_4] => 1 [:db_condition_placeholder_5] => officer [:views_join_condition_0] => 0 [:views_join_condition_2] => 0 )
and of course, the view will not display.
I can't take a close look at this now, but I thought I'd report it to the community. in case anyone else has encountered it. I will parse through the error message later to see if I can figure out what is going on.
| Comment | File | Size | Author |
|---|---|---|---|
| #208 | drupal-11.3.9.patch | 20.48 KB | jan kellermann |
| #196 | 2815881-196.patch | 20.08 KB | fernly |
| #19 | Screen Shot 2017-01-30 at 18.16.21.png | 31.19 KB | john cook |
| #19 | Screen Shot 2017-01-30 at 18.14.43.png | 189.3 KB | john cook |
Issue fork drupal-2815881
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 2815881-switching-on-aggregation-main
changes, plain diff MR !15824
- 2815881-switching-on-aggregation-11.x-new
changes, plain diff MR !15823
- 2815881-switching-on-aggregation-10.2.x
changes, plain diff MR !7577
- 2815881-switching-on-aggregation-10.1.x
changes, plain diff MR !2987
- 2815881-switching-on-aggregation
changes, plain diff MR !349
- 2815881-9.1.x
changes, plain diff MR !350
- main
compare
- 11.x
compare
- 2815881-switching-on-aggregation-11.x
changes, plain diff MR !6073
- 10.1.x
compare
Comments
Comment #2
lendudeIt's trying to find a field field_officer_contact_form_ on the contact form entity. Does this exist? Is this an entity reference field to a contact form entity or something else? I'm just trying to get a feel of which parts of core are involved in this.
Maybe you can attach a yml export of this particular view config? That might help us identify the components involved in this.
Comment #3
RKopacz commentedHere is the configuration Export file for the view:
The contact form is added to the officer content type using a link field. Might that be the problem? I am rewriting the title field to be a link to the contact form, so that link field is hidden in the display. Some officers hold more than one position, so those officers repeat in the list. The standard way of eliminating that display is aggregation. Turning on aggregation caused the problem.
Should I use the entity reference instead?
Comment #4
RKopacz commentedOkay, so I added the Contact form as an entity reference field. I then tried to create a relationship, and as soon as I created it, I received this error:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rosenet_wp._node__field_test' doesn't exist: SELECT taxonomy_term_field_data_node__field_officer_position.weight AS taxonomy_term_field_data_node__field_officer_position_weight, node_field_data.nid AS nid, taxonomy_term_field_data_node__field_officer_position.tid AS taxonomy_term_field_data_node__field_officer_position_tid FROM {node_field_data} node_field_data LEFT JOIN {node__field_officer_position} node__field_officer_position ON node_field_data.nid = node__field_officer_position.entity_id AND (node__field_officer_position.deleted = :views_join_condition_0 AND node__field_officer_position.langcode = node_field_data.langcode) INNER JOIN {taxonomy_term_field_data} taxonomy_term_field_data_node__field_officer_position ON node__field_officer_position.field_officer_position_target_id = taxonomy_term_field_data_node__field_officer_position.tid LEFT JOIN {node__field_test} node__field_test ON node_field_data.nid = node__field_test.entity_id AND (node__field_test.deleted = :views_join_condition_2 AND node__field_test.langcode = node_field_data.langcode) LEFT JOIN {} _node__field_test ON node__field_test.field_test_target_id = _node__field_test.id WHERE (( (node_field_data.status = :db_condition_placeholder_4) AND (node_field_data.type IN (:db_condition_placeholder_5)) )) ORDER BY taxonomy_term_field_data_node__field_officer_position_weight ASC; Array ( [:db_condition_placeholder_4] => 1 [:db_condition_placeholder_5] => officer [:views_join_condition_0] => 0 [:views_join_condition_2] => 0 )Bug? Why does it say the table does not exist when I just created the reference and populated the fields on the existing nodes with references?
I'm trying to get relationship to the referenced form because my main goal is to get the path to the contact form, so that I can rewrite the title of the node that is the subject of the view as a link to that contact form. But I can't even seem to create that relationship in the view.
Comment #5
RKopacz commentedAnybody have any thoughts on this? I'm facing it for a third time when I try to turn on aggregation on views. Unkown column for a field, but the field is in the field list.
Comment #6
lendude@RKopacz well some clear steps to reproduce with a vanilla core install would be the best thing to get this moving. That way we can write some tests for this and fix this. Cause something is not right here, but what.
You say you have seen this multiple times, but was it always related to a view using the contact form in some way?
Comment #7
RKopacz commented@Lendude, thanks for the message. It is always happening when another entity is referenced, and when I am trying to use a field in the display from that entity. In the most recent case, it was a reference to a content entity that I had created, which was just a simple field on a node, for which I created a relationship to display one of the fields in the referenced entity. Since I referenced more than one entity in that field for one of the referencing nodes, the referencing node appeared twice in the list. I then tried to aggregate. But the SQL error message, when it popped up was nagging about a file field on the referencing node. That's also a reference in 8, but I did not create a relationship to it, because I did not think I needed to. Might that be it?
The prior time, it was a reference to a taxonomy term, where I had more than one term per node, and when I tried to display the taxonomy term in the node, the node appeared twice. But SQL was nagging me then about a link field that contained a relative URL to the contact form. After your post in #2, I tried the contact form as a reference field, but still got the same problem.
It could very well be a configuration issue that I am not considering in 8.
I will definitely try the vanilla core install, perhaps on Sunday, and see what else pops up.
Comment #8
manojapare commentedThe same issue I faced, after some hours of digging I found that it is due to field aggregation settings. But this is not happening for all fields, only for field having multiple columns value like image having columns target_id, alt, title, height and width.
These are the steps to reproduce the issue:
For now I solved by just saving the image field aggregation settings:

I know this is not a permanent solution. Will try to fix it and give a patch for the same.
Comment #9
manojapare commentedComment #10
manojapare commentedComment #11
rakesh.gectcrPatch applies fine and it works, So making it RTBC. Would love to see what Core maintainers / View maintainer @dawehner says.
Comment #12
lendude@manojapare nice work finding some steps to reproduce! Tested the steps and indeed there is an error when using an image field. A node ref didn't have any problems.
So if I understand correctly, the reason this happens is because there is no default value for the aggregation? And by saving the settings, a value gets set, and the problem goes away.
So this would mean that
$fieldsdoesn't get set and the call to$this->addAdditionalFields($fields);will add all additional fields.Is there no way to set a proper default? Because defaulting to 8 fields getting added (in the case of an image field) to the query also doesn't sound great. And there is really no way to tell that this is happening other then looking at the query that was build.
Also this will need some tests.
Comment #13
lendudeOh and this will need a separate patch for 8.3.x because the handler got renamed to
\Drupal\views\Plugin\views\field\EntityField(but no need to worry about that yet)Comment #14
manojapare commented@Lendude That's a good catch. Yeah as you commented $this->addAdditinalFields() adding all additional fields. So as per my observation to prevent it we need to make it run similarly when aggregation is not set.
Below patch will avoid adding all additional fields if group_column for the filed is not set.
Comment #15
rakesh.gectcrIn case of aggregation not set and multiple value field, if
($this->add_field_table($use_groupby) && !empty($this->options['group_column']))condition statements won't be executing. But those need to be executed in the same caseComment #16
manojapare commented@rakesh.gectcr Thanks for the quick review.
Please review the latest patch.
Comment #17
john cook commentedI can confirm that the work around of editing the Image's aggregation settings will fix the problem.
But I tried to apply patch #16 but fails to apply.
As 8.2.x is no longer in development, upping the version to 8.3.x and adding "Needs reroll" tag.
Comment #18
manojapare commented@john-cook The patch is failling to apply on 8.3.x branch beacuse Drupal\views\Plugin\views\field is been deprecated and instead we need to use Drupal\views\Plugin\views\field\EntityField.
Please find and review the rerolled patch for 8.3.x branch.
Comment #19
john cook commentedI've tested patch #18 against 8.4.x.
The patch does prevent the SQL error from appearing.
Before:

After:

I cannot see any problems with the code.
I would set this to RTBC but there still needs to be a test created to ensure that this isn't reverted. Because of this I'm setting this back to Needs work but removing the Needs re-roll tag.
Comment #20
john cook commentedTidied issue summary.
Comment #21
manojapare commentedI don't have any experience in writing test in Drupal. Can someone guide me or give documentation on how to write tests.
Comment #22
jofitzHere is a rather clumsy (but effective, nonetheless) pair of tests for the proposed change. This should at least give you something to start from.
Comment #24
manojapare commentedThanks Jo Fitzgerald this one is very useful to start with PHPUnit.
I am changing the status to `Needs work` because in unit test one more condition in add_field_table need to be covered.
Comment #25
manojapare commentedI have written unit test for covering the missed condition in add_field_table method to ensure that this scenario is handled in future as well. Once again thanks to Jo Fitzgerald.
Please review it.
Comment #26
lendudeI like the test coverage here, but still not convinced by the fix. To me, the underlying problem is that apparently no default gets set in
\Drupal\views\Plugin\views\field\EntityField::defineOptions. Why doesn't the image field/entity ref get a default?This fix leads to all columns getting added, which might be nice as a last resort, but for a frequently used field type we need to look at getting the right default too I feel.
Comment #27
manojapare commented@Lendude, Thanks for reviewing the patch. I too wondered the same question: Why doesn't the image field/entity ref get a default?
These are my findings for the same:
\Drupal\views\Plugin\views\field\EntityField::defineOptionsall column names are been obtained from field storage definition.$default_columnis been determined by this code,$default_columnonly$options['group_column']is been set asIn case of normal fields say node title,
$column_names = ['value']. But in case image field,$column_names = ['target_id', 'alt', 'title', 'width', 'height']. Hence for image/entity ref$default_columnwill be empty string which in-turn causes the problem.I even tried just changing the code for determining default column in
\Drupal\views\Plugin\views\field\EntityField::defineOptionslike below:which will set default_column for any field having additional fields. But this is also not solving the issue.
Let me know if this is not the way to debug or to fix it.
Comment #28
lendudeI would do something like this. This only works for fields that have been added after applying the patch, existing fields will have a empty default.
This will need an integration level test.
And depending on what we want to do here, it will also need an upgrade path to fix the existing field defaults. Optionally we can not do an upgrade path and let the existing fields use the fallback introduced here for fields that we can't determine a default column for. But I would say an upgrade path would be the way to go here.
Comment #29
lendudeComment #30
manojapare commented@Lendude, This is working fine.
But still I am wondering, why even after setting default_column and hence options['group_column'] the error is been not fixed.
Comment #31
lendude@manojapare because the default gets set when you add the field to the View. So any existing fields will already have the wrong default, but newly added fields will work with the new default.
Comment #32
lendudeNew test. Test only patch only contains the new test and is the interdiff.
This still needs an upgrade path.
Comment #34
lendudeUpgrade path and test.
Comment #35
lendudeQuick cleanup.
Comment #36
lendudeUpdated the I.S. to reflect the current fix.
Comment #37
dawehnerWell, and otherwise choose the first available column?
Comment #38
lendudeSounds good, but then we can just 'else' to the first column if 'value' isn't found. So something like this.
8.3 version won't apply to 8.4, so 2 versions.
Comment #39
lendudeMissed a little cleanup.
Comment #40
dawehnerComment #42
lendudeNeeds reroll because of #2776975: March 3, 2017: Convert core to array syntax coding standards for Drupal 8.3.x RC phase
Comment #43
lendudeRerolled
Comment #44
dawehnerJust a reroll, the world is still green.
Comment #46
lendudeAnd another reroll...
Comment #47
lendudeAdded a test view from another issue to the 8.4.x version, duh! 8.3.x didn't change but re-uploading to keep them together
Comment #48
dawehnerAnother re-RTBC
Comment #49
imiksuCan we have before & after screenshots?
Comment #50
craigada commentedComment #51
sonona commentedPlease see before and after screenshots
Comment #52
sonona commentedComment #53
alexpottI think we need to do a fix in Views::preSave() too. Similar to what we did in #2248983: Define the revision metadata base fields in the entity annotation in order for the storage to create them only in the revision table so views from a modules config/install or config/optional folder are fixed too? No?
There's really nice test coverage on this patch.
Comment #54
craigada commentedComment #55
lendude@alexpott yes, you are of course correct.
Added a private function called in preSave(), the actual changes are done by that function when running post_update so the upgrade test covers both the post_update and the preSave()
Comment #56
lendudenow with the actual patch....
Comment #58
lendudeThat is the 8.4.x version, will roll a 8.3.x version if this lands
Comment #60
manojapare commentedTested in 8.4.x branch, working fine and unit test and coverage looks fine. Marking as RTBC, even though found usage of 2 deprecated methods fixTableNames() and fixEmptyGroupColumn() in preSave () of View entity class.
Comment #61
xjmGreat work on the update path and tests!
I found something small that needs fixing here:
Private and deprecated is a strategy I haven't seen before for an update helper. Seems reasonable. I guess
fixTableNames()is the same.However, we need to update the version here (not 8.3.0 anymore) and we should also add a
@trigger_error()in the code path for it. (Probably just the top of the function.)Queuing SQLite and PostgreSQL tests for this as well.
Comment #62
lendudeUpdated the version, added the trigger_error, changed the update test to a BTB test
Comment #63
manojapare commentedQueuing SQLite and PostgreSQL test for both 8.4.x and 8.5.x
Comment #64
manojapare commented@lendude Good job. Both patch for 8.4.x and 8.5.x applies fine and it is working fine. Making it RTBC.
Would like to see what Core maintainers says.
Comment #66
lendudeNeeded another reroll, 8.4.x was still good, reupping to keep everything together
Comment #67
manojapare commentedBoth patch for 8.4.x and 8.5.x applies fine and it is working fine. Making it Re - RTBC.
Comment #68
catchI think the trigger_error() should not be at the top of the function since we always run it unconditionally. It's not actually deprecated code, it's a bc layer which is a bit different.
Instead shouldn't we put it here so it only runs when there's a View that needs fixing?
Comment #69
manojapare commented@catch,
Let me revamp the points to make sure I got your points. First of all, this method is been called for all view irrespective of view needs fixing or not. And this method is part of bc layer and not a deprecated one.
Based on the above point you are suggesting to trigger deprecation error only when the view needs actual fixing.
IMHO. Here the whole method is part of bc layer not just a part of it. So we need to trigger deprecation unconditionally all the time.
Comment #70
tstoecklerSorry for jumping in here so late, but are we sure this is needed? If a field type decides not to have a main property I think we should respect that. And since even before you can run into cases where
$default_columnis empty, I don't really understand why we do so much magic. Or is that precisely the bug here? (It's a bit hard to tell) If the latter is the case, I think we should at least drop the hardcoding of a "value" column and just always use the first one.Comment #72
manojapare commentedRe-rolled the patch for 8.5.x. Also made changes as per @tstoeckler suggestion.
Comment #74
seanbStraight up rerolled #66 for 8.5.x. For some reason creating an interdiff was not possible so here is just the patch.
Comment #76
josueValRob commentedAnyone has tested it with rest views?.
I am facing a similar problem:
I have a rest view of a taxonomy term (books) and wants to add a contextual filter by the category. /books/drama. To do that, I add the relationship with the taxonomy term category and all the content get's duplicate. To fix it, I enable the aggregation but PUM! an SQL error.
Any idea?.
Drupal 8.6
Comment #77
biigniick commentedI think I'm having this issue too with 8.6
SQLSTATE[42S22]: Column not found: 1054 Unknown column- Nick
Comment #78
panchoLet's get this one fixed, finally. Retesting the last patches, will then provide an interdiff and reroll against 8.6.x-dev.
Comment #79
panchoFirst step: Here's the missing interdiff #66 -> #72, showing:
Comment #80
panchoSo here's another patch based on #66, yet taking into account both #68 and #70, and of course rerolled against 8.6.x-dev.
Let's see if we can bring the number of test fails down again.
Comment #82
panchoNice. So here I'm fixing the rather new media view and a test view, and codesniffer's CS fix.
Now there shouldn't be more than a handful of test fails.
Comment #84
pancho1.)
$display_namerenamed to$display_idfor clarity.2.)
First thought we could get the handler for a particular display without setting and getting the display, but no we can't: #3034692: getHandler() != getHandler().
only gives me the handler configuration, not the actual handler object, so leaving everything as it is, except for the first two lines that can be chained.
3.)
This doesn't make any sense:
We can't do a
getMainPropertyName()on NULL, neither can we do agetColumns()on NULL.This is more correct:
and hopefully enough.
4.)
Finally, following line was missing to make it all actually work:
Hope we got it right now. Let's have another test run to see how things turn out.
Comment #86
panchoComment #87
panchoStraight reroll against 8.8. Interdiff didn't work, so here's a plain diff.
Comment #88
panchocan't work. My fault, introduced in #84, now reverted.
Also replaced the deprecated getMock() by createMock() in the tests we're introducing to Drupal\Tests\views\Unit\Plugin\field\FieldTest.
Comment #89
panchoAnother incorrect change, again my fault, introduced in #80, now reverted:
We're only attempting to load the field's storage.
Comment #90
panchoComment #91
panchoAnd following #3023981: Add @trigger_error() to deprecated EntityManager->EntityRepository methods, we need to replace
$this->entityManagerby$this->entityFieldManagerand/or$this->entityTypeManager.Now let's see if there's still something missing to make our bots happy... :)
Comment #92
panchoNice, only deprecation notices left, which may now be suppressed by
@group legacy.I'm also pushing our new deprecation notice to Drupal 8.7.x, as I don't see this being cherrypicked into Drupal 8.6.x anymore.
Tested green locally, so finally ready for review!
Comment #93
divined commentedHi! I don't know when it happens, but views don't display "list text" fields with enabled aggregation.
Comment #94
adam1 commentedOn Drupal 8.6.15 I ran into the above issue. But I couldn't find a working patch for this version. Could someone give me a hint which one to use?
Comment #95
super_romeo commented#92 Patch Failed to Apply.
Comment #96
daffie commentedComment #97
vacho commentedPatch rerolled.
Comment #98
tclark62 commentedWhen I apply the patch, Hunk #1 for the file core/modules/views/tests/src/Kernel/QueryGroupByTest.php failed at 3, but everything else applies cleanly and it seems to fix the problem for me. Using 8.7.6, which may be the reason it didn't all apply cleanly.
Comment #99
mturner20 commented#97 worked for me! Thank you @vacho!
Comment #101
john cook commentedThe patch from #97 does not apply to the 8.9.x branch. Another reroll is needed.
Comment #102
john cook commentedAdded "novice" tag for the reroll.
Comment #103
akashkumar07 commentedI have reroll the patch #97. Hope, this will solve the issue.
Comment #104
akashkumar07 commentedThis patch should fix the PHPLint Error.
Comment #105
akashkumar07 commentedThis patch should fix the PHPLint Error.
Comment #107
ravi.shankar commentedComment #108
drase15 commentedHi,
Anyone get success to install this patch?
If so someone can help me?
I'am installing this with composer
After added that to my composer.json run command "composer install" and get an error:
"Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2019-07-26/2815881-97.patch"
I'm using #97 patch.
Or if anyone could solve this issue (image field with aggregation not working) with another solution please share.
Thanks in advance :)
Comment #109
super_romeo commentedPatch #97:
Comment #110
sokru commentedReroll from #97.
Comment #112
mradcliffeI performed Novice Triage on this issue. I am leaving the Novice tag on this issue because it looks like the test failures are pretty straightforward to fix.
Also I think the deprecation notices are out-of-date in the patch.
It would also be helpful to run the issue through the major issue triage process.
Comment #114
narendra.rajwar27Comment #115
narendra.rajwar27Tried to apply comment #110 patch, but it is not getting applied in 8.9.x branch. Patch applied successfully in 8.8.x branch. So updating the patch for 8.9.x branch. For 9.1.x branch there is mismatch of code in files. I will update patch for 9.1.x after it passes for 8.9.x branch.
Comment #117
narendra.rajwar27adding fix for failed test case
Comment #118
narendra.rajwar27Patch applied in Drupal9.1.x.
Comment #120
narendra.rajwar27Comment #121
narendra.rajwar27fix added for failed test cases.
Comment #122
sharma.amitt16 commentedTested patch #21 with 9.1.x branch. Before applying the patch, I am able to reproduce the error on drupal 9.1.0-dev.
Before applying the patch I got the error.
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node__field_image.field_image_' in 'field list': SELECT "node_field_data"."title" AS "node_field_data_title", "node__body"."body_value" AS "node__body_body_value", "node__field_image"."field_image_" AS "node__field_image_field_image_", "node_field_data"."created" AS "node_field_data_created", MIN(node_field_data.nid) AS "nid" FROM {node_field_data} "node_field_data" LEFT JOIN {node__body} "node__body" ON node_field_data.nid = node__body.entity_id AND (node__body.deleted = :views_join_condition_0 AND node__body.langcode = node_field_data.langcode) LEFT JOIN {node__field_image} "node__field_image" ON node_field_data.nid = node__field_image.entity_id AND (node__field_image.deleted = :views_join_condition_2 AND node__field_image.langcode = node_field_data.langcode) WHERE ("node_field_data"."status" = :db_condition_placeholder_4) AND ("node_field_data"."type" IN (:db_condition_placeholder_5)) GROUP BY node_field_data_title, node__body_body_value, node__field_image_field_image_, node_field_data_created ORDER BY "node_field_data_created" DESC LIMIT 11 OFFSET 0; Array ( [:db_condition_placeholder_4] => 1 [:db_condition_placeholder_5] => article [:views_join_condition_0] => 0 [:views_join_condition_2] => 0 )After applying patch #121, it solves the problem. It works well and giving an output of view with aggregation without any error.
Comment #123
lendudeWe now have ViewsConfigUpdater available to store these methods on, so let's move them there.
This got added in #117 but has nothing to do with this issue, this needs to be removed again.
Comment #124
rajeev_drupal commentedComment #125
rajeev_drupal commentedpatch #121 works for. After applying the patch not getting SQL error.
Comment #126
rajeev_drupal commentedComment #127
lendudeComment #128
mohrerao commentedFixed changes suggested in #123
Comment #129
lendude@mohrerao now the upgrade path test is missing and my first point in #123 was not addressed at all
Removing the novice tag because this is not a novice task anymore.
Comment #131
prairiedog commentedFor what's it's worth, we were having an issue with images columns as well... #8, way back in the thread above, worked for us. (Project we're on is Drupal 8.9.7; changing the aggregation on images solved the problem after our team had spent hours.)
@manojapare - thanks.
Comment #132
jungleAddressing #123 based on the patch in #121.
Tagging "Bug Smash Initiative"
Comment #133
jungleSorry, forgot attaching the patch.
Comment #134
jungleA patch for 9.1.x
Comment #135
jungleIgnore the patches in #133 and #134 please.
Trying to address #123 based on the patch in #121 again.
Comment #138
jungleComment #139
jibranAre we missing this update hook?
Comment #140
jungleThanks @jibran, It exists in #118, but got removed in #121
Comment #143
seanbAdded a patch for 9.3.x based on the latest MR.
Comment #145
lendudeBased this of the patch in #143
Comment #146
mkimmet commentedTested patch #145 on Drupal 9.3.0 and seems to be working. Fixed the 1054 Unknown Column error I was seeing, for what it's worth.
Comment #147
troybthompson commentedSolved my problem with 9.3.9. After adding the image field, I had to go into the aggregation setting for the field and save it before the error went away.
Comment #148
prasanth_kp commentedApplied patch #145 and issue fixed
Before patch:
 Drush Site-Install.png)
After patch:
Comment #149
klemendev commentedNice, hope this gets into core soon as this is really annoying bug
Comment #150
klemendev commentedComment #151
klemendev commentedAs per #146, #147 and #148, makring RTBC.
Let's hope we get this into core asap :)
Comment #152
lendudeQuick reroll
Comment #154
lendudeA broken view got added in #3173180: Add UI for 'loading' html attribute to images, hopefully this fixes it again.
Comment #156
spokjeWe seem to hit the PHP 8.1 change for
(mb_)strtolower(NULL)being deprecated: https://3v4l.org/fAUcN.core/modules/views/tests/fixtures/update/views.view.group_column_post_update.ymldoesn't have anuuid, which leads to this deprecation error:when testing against PHP 8.1.
The same test passes with (for example) PHP 7.4
Comment #157
spokjeUnsure if we should address the whole
(mb_)strtolower(NULL))deprecation issue here, but if we add anuuidto thegroup_column_post_updateView all seems to pass on PHP 8.1 and lower.Also changed `Master` to `Default`.
Let's see if these changes please the TestBot Gods...
Comment #158
spokjeGreen Testbot (after an initial JStest failure).
Putting this on NR, not back to RTBC because of:
Comment #161
super_romeo commentedPHP 8.1 & MySQL 8 Patch Failed to Applyon D9.4Comment #162
ravi.shankar commentedAdded reroll of patch #157 on Drupal 9.4.x.
Comment #163
nod_Thanks for the reroll! there is still a problem on the patch for the 10.1.x branch unfortunately.
Comment #164
spokjeComment #166
spokjeThis is as far as I can take this MR. I have no clue why those 2 test failures happen.
Comment #167
nod_Thank you!
Comment #169
alexdoma commentedfixtures files was removed here - https://www.drupal.org/project/drupal/issues/3261245#comment-14539406
i just remove it but perhaps we need to rewrite tests
re-roll for drupal 10.1.0
Comment #170
klemendev commentedNeeds work or is it needs review?
Comment #171
alexdoma commentedNeeds work with tests and needs review
Comment #172
jsutta commentedRerolled the patch for Drupal 10.2.x.
Comment #173
joelpittetThanks for the reroll. We use this in production as it gets past the failed SQL query on aggregation
Comment #174
alexpottPatches are no longer tested by d.o - can #172 by turned into an MR against 11.x and all the patches and other MRs hidden. Thanks!
Comment #180
capysara commentedI created a MR using the patch in #172, against d11. It still needs work because of failing tests.
Comment #181
lendudeDid some clean up, no idea what spellcheck is complaining about.
I think we still need an upgrade path test for this
Comment #182
lendudeApparently doing a merge to resolve conflicts makes spellcheck croak....#3401988: Spell-checking job fails with "Argument list too long" when too many files are changed, so needs a rebase
Comment #184
tcrawford commentedThe blocking issue #3401988 seems to be resolved and the spellcheck has passed after merging 11.x into the issue fork. However, now other tests are failing in the pipeline.
Comment #186
tcrawford commentedThe MR (!603) against 11.x is now mergeable and pipeline is now passing. Therefore, I am moving the status to 'needs review'.
Comment #188
pfrenssenThanks for keeping up with this and making an MR against 11.x! Reviewed the latest changes and the full patch. Looking good, tests are passing. Review remarks have been addressed. Back to RTBC!
Edit: I reviewed only the 11.x branch. I closed 10.1 since it was out of date. 10.2.x is still being maintained but I did not review it.
Comment #189
klemendev commentedGreat work, can't wait to have this in the release! :)
Comment #190
alexpottAdded some review comments on the MR to address. The MR also needs to be rebased or have the latest 11.x merge and conflicts resolved.
Comment #192
jan kellermann commentedRe-rolled against current 11.x
Comment #193
fernly commentedStable patch of current MR state.
Comment #194
fernly commentedPatch in 193 is not applying to 11.2.x. Weirdly enough, because 11.x got merged in the MR one month ago. Hiding the patch for now.
Comment #195
smustgrave commentedLeft some comments on the MR.
Also CR was last updated in 2021 so could use some updates probably.
Comment #196
fernly commentedThe 11.x merge request is totally out of sync with the actual Drupal 11.x version. We need a backmerge.
Created a stable patch that is applicable to Drupal 11.2.3 based on the 11.x MR 6073.
Comment #197
joelpittetAddressed the MR comments and fixed a bug in this commit https://git.drupalcode.org/project/drupal/-/merge_requests/6073/diffs?co...
Comment #198
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #206
jan kellermann commentedPatch ported for current D11 in new branch.
Just use branch https://git.drupalcode.org/issue/drupal-2815881/-/tree/2815881-switching... for current 11.3 version.
Comment #207
jan kellermann commentedCreated MR for main and plese review
https://git.drupalcode.org/project/drupal/-/merge_requests/15824
Comment #208
jan kellermann commentedAdded Patch for Drupal 11.3.9
Comment #209
smustgrave commentedCan we get test coverage for the update hook please.