I installed csv-export together with views_data_export (Drupal 8.5.3) . Blocked the export for all users that have not the right to administer users in views (not logged in and also logged in with no appropriate rights).
Then I tried to access the export with no appropriate rights (https://www.mydomain.org/user-data-export?_format=csv). The results: "The 'administer users' permission is required." I am not sure whether I find that good or if it tells the user too much. Most probably a Views thing.
From this I go back to the main domain (https://www.mydomain.org) and get a lot of error messages starting with:
Notice: Undefined offset: 0 in Drupal\csv_serialization\Encoder\CsvEncoder->extractHeaders() (line 176 of modules/contrib/csv_serialization/src/Encoder/CsvEncoder.php).
Drupal\csv_serialization\Encoder\CsvEncoder->extractHeaders(Array, Array) (Line: 143)
Drupal\csv_serialization\Encoder\CsvEncoder->encode(Array, 'csv', Array) (Line: 40)
Symfony\Component\Serializer\Encoder\ChainEncoder->encode(Array, 'csv', Array) (Line: 272)
No idea whether this is a views, csv_serialization or views_data_export . But the error messages are all from csv_serialization. After reload all error messages disappear.
Comment | File | Size | Author |
---|---|---|---|
#2 | fixes-php-warning-2975802-2.patch | 485 bytes | s.messaris |
Comments
Comment #2
s.messaris CreditAttribution: s.messaris commentedHere is a patch for the errors. The checking of the array being empty was not enough, since it can be
Comment #3
s.messaris CreditAttribution: s.messaris commentedComment #4
s.messaris CreditAttribution: s.messaris commentedHey, I have being using this the last month without issues, and it is a pretty simple fix. Can someone else RTBC this so that maybe we can have this commited?
Comment #7
grasmash CreditAttribution: grasmash at Acquia commentedWhat if we just cast it to an array instead?
Comment #9
tjtj CreditAttribution: tjtj commentedYet again, as a user I have to run down a patch. Why isn't this installed automatically in the distribution? This makes using Drupal unnecessarily difficult.