- First commit to issue fork.
- π¦πΊAustralia elc
I've been using this patch to fix up SUM(fraction) successfully for years now, but it has just stopped working and I'm having problems narrowing it down to the exact failure. I haven't been able to narrow down the timeframe for when the failure happened either, except that it was either last week, or all the way back in January. It doesn't seem to line up with releases of this module.
Key to it is that
$field->field_alias == 'unknown'
for all of the Fraction fields in a view. That was causing the complete failure of what this patch was doing.I've reworked the patch from #11 into 3.x-1515840-fix-sum to at least give me the correct answers in
$view->results
at hook_views_pre_render() time, but all of the fields are still considered empty and rendered as such. It seems very much like the field_alias being considered the default "unknown" by the field handler is the bugbear.I had to change ordering of the 'entity field' vs 'field_name' in field definition since every field now has 'field_name', even if it is an entity field. This was resulting in no fields being found for fraction base fields.
The attempt to compensate for the field_alias being missing is not the correct way to go. Determining why that is missing is where I am currently focussed.
I have not created a MR as this still needs work. Some additional eyeballs would be greatly appreciated. Dumping to 3.x branch.
- πΊπΈUnited States m.stenta
@elc What version of Drupal core and Fraction are you using?
I wonder if this change has anything to do with it?
https://git.drupalcode.org/project/fraction/-/commit/f34523b9fe859f80745...
That is the only substantive change to the 2.x branch since January.
Key to it is that
$field->field_alias == 'unknown'
for all of the Fraction fields in a view. That was causing the complete failure of what this patch was doing.Otherwise, I wonder if something changed in Drupal core / Views that could explain the new behavior you're seeing. π€
- π¦πΊAustralia elc
Site is running Drupal 10.4.6 and Fraction 3.0.1.
I've been searching Drupal Core for any related changes without any luck. I haven't figured out how field_alias is ending up either with no value set, or the value set being unknown. The field is present in the query while the alias is unknown, which is weird itself since there has already been an alias calculated as the array key, and set as a key in the array too.
I'll reverse that commit and see if it makes any difference. First look is that it's only the category name that has changed. Hard pressed to think that would make a difference.