Problem/Motivation

Before in Version 1.0.7 the keys for each object came in exactly as constructed as in the CSV document. Now that I have upgraded to version 1.0.8 site isn't functioning correctly because a change has now modified how those keys are brought in to the view results.

My keys used to be the following for each CSV field:
["Q1" => "43128"]
And now they are this:
["q1___value_13" => "43128"]

I use the "views_get_view_result" functionality to grab my data to do some custom work from these views and it was reliant on the capitalization and the exact key names in the CSV data. I can imagine that others might have a similar issue with this. Is there a setting in the view to tell it to leave the keys alone? If there isn't there should be. Please advise.

Steps to reproduce

Install version 1.0.7 look at the output with "views_get_view_result"
then
Install version 1.0.8 look at the output with "views_get_view_result"

Proposed resolution

Have an option that leaves the keys in place as they were without modification. For now I've been forced to downgraded my version to 1.0.7.

Command icon 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:

Comments

deasly created an issue. See original summary.

andileco’s picture

Hi @deasly - thanks for reporting this, and apologies for the disruption...we played things a little fast and loose because it seemed like there wasn't a ton of usage yet.

The use of the aliases has some usefulness, as it allows one to add the same column multiple times and to use it for different aggregation options, etc. But we definitely understand where you are coming from. I think what we're proposing is to have both the alias and the original column available so that you can still easily do what you're wanting without losing some of the benefits of the alias.

Please let us know what you think of this approach!

deasly’s picture

Hi @andileco - No worries i totally understand. That's the growing pains of a newer module. But its definitely a great one and have to commend you on its quality. I think the approach of having both is definitely a great one. Might want to define the downsides of using unmodified keys really well in the settings as mine is kind of a unique one i think (using the views data object directly). I imagine in the query settings having a single boolean option that states:

- Leave header keys unmodified in Views Object. (Disclaimer: this will disable your ability to have this functionality that the module provides and explain that functionality here.)

Or something like that. Then have it unchecked by default so that new users of the module don't miss out on the great new additions you add with the new setup.

Is this kinda where you were thinking of going? If i can help the thought process out any let me know.

P.S. I wish i had this module way back in Drupal 6 lol.

nikathone made their first commit to this issue’s fork.

nikathone’s picture

Version: 1.0.8 » 1.0.x-dev
Assigned: Unassigned » nikathone

nikathone’s picture

Assigned: nikathone » Unassigned
Priority: Critical » Major
Status: Active » Needs review

Hi @deasly, I didn't add a setting but now the column key should be present. You should have something like

<?php
["q1___value_13" => "43128", "Q1" => "43128"]
?>

Note that if you apply aggregation and use a field twice then it might worth get the value from the alias key instead of the column based your need. Sorry for the disruption caused by the alias addition.

deasly’s picture

Hi @nikathone, This sounds good. I will probably be able to test this patch early next week. I will let you know when I do. Thanks for your work with this.

deasly’s picture

Status: Needs review » Reviewed & tested by the community

Hi @nikathone, I tested this MR out and it works perfectly for my needs. I would consider this MR good to merge whenever you get the opportunity. Thanks again for your help.

  • andileco committed 47cb0467 on 1.0.x authored by nikathone
    Issue #3503192 by nikathone: Version 1.0.7 -> 1.0.8 broke my list views...
andileco’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for reviewing, @deasly - merged!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.