Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Rvice opened this issue Mar 7, 2024 · 10 comments
Assignees
Milestone

Comments

@Rvice
Copy link
Contributor

Rvice commented Mar 7, 2024

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:
    `

Notice: ob_clean(): failed to delete buffer. No buffer to delete in /admidio/adm_program/system/classes/ListData.php on line 266
` **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):

  • Admidio-Version: 4.3.3 and 4.3.5
  • PHP: 7.4.10
  • Database MySQL
  • Browser: Chrome
  • Browser-Version: N/A

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

@Rvice Rvice changed the title Exporting "former members" to CSV results in failed to delete buffer and "index" column missing Exporting "former members" to CSV results in failed to delete buffer and "No." column missing Mar 7, 2024
@Fasse
Copy link
Member

Fasse commented Mar 7, 2024

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
Copy link
Contributor Author

Rvice commented Mar 7, 2024

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
Copy link
Contributor Author

Rvice commented Mar 7, 2024

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.

@Rvice Rvice changed the title Exporting "former members" to CSV results in failed to delete buffer and "No." column missing Exporting from Groups to CSV results in failed to delete buffer and "No." column missing Mar 8, 2024
@Fasse
Copy link
Member

Fasse commented Mar 15, 2024

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.

@Fasse Fasse added the invalid label Mar 17, 2024
@Fasse Fasse closed this as not planned Won't fix, can't repro, duplicate, stale Mar 17, 2024
@Rvice
Copy link
Contributor Author

Rvice commented Mar 18, 2024

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

@Rvice
Copy link
Contributor Author

Rvice commented Mar 18, 2024

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
Copy link
Contributor Author

Rvice commented Mar 18, 2024

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

#1612

@Fasse Fasse added this to the v4.3.6 milestone Mar 18, 2024
@Fasse
Copy link
Member

Fasse commented Mar 18, 2024

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.

@Fasse Fasse reopened this Mar 18, 2024
@Fasse Fasse closed this as completed Mar 18, 2024
@Rvice
Copy link
Contributor Author

Rvice commented Mar 18, 2024

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
Copy link
Contributor Author

Rvice commented Mar 27, 2024

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 #1612, i.e. something is out of whack in my instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants