Admidio / admidio

Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.
https://www.admidio.org
GNU General Public License v2.0
297 stars 121 forks source link

Exporting from Groups to CSV results in failed to delete buffer and "No." column missing #1607

Closed Rvice closed 2 months ago

Rvice commented 2 months ago

Describe the bug Exporting "former members" to CSV results in failed to delete buffer and "No." (index) column missing in export

To Reproduce Steps to reproduce the behavior:

  1. Go to Groups & Roles
  2. Click on Former Members from one of the roles
  3. Click Export to CSV
  4. See error in CSV output: <br /> <b>Notice</b>: ob_clean(): failed to delete buffer. No buffer to delete in <b>/admidio/adm_program/system/classes/ListData.php</b> on line <b>266</b><br /> Expected behavior Expect to see the index column and no error message at the top of the export

Screenshots -None-

System (please complete the following information):

Additional context This was working prior to the big changes to 4.3

Fasse commented 2 months ago

I could not reproduce this at our demo space. Does this occur at any role? Does this only occurs at csv export? Work the export to excel?

Rvice commented 2 months ago

This is happening on all exports and with various different list configurations and groups (former and current regardless)

Export to .xlsx is even worse Fatal error: Uncaught Error: Class 'XMLWriter' not found in /admidio/adm_program/libs/server/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php:5 Stack trace: #0 /admidio/adm_program/libs/server/composer/ClassLoader.php(578): include() #1 /admidio/adm_program/libs/server/composer/ClassLoader.php(432): Composer\Autoload\ClassLoader::Composer\Autoload\{closure}('/admidio/adm_pr...') #2 [internal function]: Composer\Autoload\ClassLoader->loadClass('PhpOffice\\PhpSp...') #3 /admidio/adm_program/libs/server/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php(27): spl_autoload_call('PhpOffice\\PhpSp...') #4 /admidio/adm_program/libs/server/phpoffice/phpspreadsheet/src/PhpSpreadsh in /admidio/adm_program/libs/server/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php on line 5

Did memory requirements maybe go up? I know the server we're on is somewhat constrained.

Rvice commented 2 months ago

Note, the export from roles in Playground no longer has the "No." column, but the category report does. DEMO-Category_report-General_role_assignment (1).csv DEMO-Member-Address_list.csv

Not sure why I'm seeing the error ~, maybe I had a dirty install. I'll re-upload the files and report back.~ Uploaded and made sure to redo the template folder too. same result.

Fasse commented 2 months ago

It looks like your PHP installation needs php-xml https://stackoverflow.com/questions/41121477/class-xmlwriter-not-found-error-in-php-php55w-xml-5-5-24-1-w6-x86-64-rpm-i

Than this function should work.

Rvice commented 2 months ago

@Fasse what about the No. column missing from the Group exports?

Rvice commented 2 months ago

Got php-xml installed, that sorta resolved the .xlsx export, but that has the same issue as the normal export with this showing at the top of the .xlsx without being able to open it in Excel.

<br /> <b>Notice</b>: ob_clean(): failed to delete buffer. No buffer to delete in <b>/admidio/adm_program/system/classes/ListData.php</b> on line <b>266</b><br />

Should the fix just be something from the suggestions here: https://stackoverflow.com/questions/14549110/failed-to-delete-buffer-no-buffer-to-delete

I'll give it a try at least.

Rvice commented 2 months ago

Adding the following to ListData.php resolved the error: if(ob_get_length() > 0) { ob_clean(); }

https://github.com/Admidio/admidio/pull/1612

Fasse commented 2 months ago

Ok, I will reopen it, because the problem with the buffer was still there in your system. I thougth this error belongs to the missing xml part of PHP.

I removed the No from export because that doesn't belongs to an export. Excel and Co have their own system to list elements.

Rvice commented 2 months ago

Re: the No. thing, should that be in the category report (it's still there in its export). This is how I observed the difference...Maybe I open a new issue on consistency?

Rvice commented 1 month ago

Futher note, I observed in the Playground that the "No." column is actually printed in the CSV export. I think this might be the issue related to https://github.com/Admidio/admidio/pull/1612, i.e. something is out of whack in my instance.