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

Bugfix: database and finish step errors #245

Merged
merged 1 commit into from
Jan 1, 2024

Conversation

danilopucci
Copy link
Contributor

I was trying to run thw website locally (PHP 8) and I found that both database and finish steps were not running successfully:

image

When this happens on Database step and by hitting Next button at this step, the Finish step were skipped. It was assuming that it was already installed on if(isset($config['installed']) && $config['installed'] && !isset($_SESSION['saved'])) {

By reading ob_end_flush() docs, and by reading the Notice message, I found that it was throwning an error (which was unhandled at this time).

After applying these changes on Database step, the same error happened on Finish step

I simple added a check if the buffer has data to flush to avoid it. Maybe the best approach would be to catch the exception. But As it is part of install, which would be executed once, I think the if check is enough.

I could not force a valid buffer to see if the end_flush would fail in the same way that it was before

@slawkens slawkens merged commit a88103a into slawkens:master Jan 1, 2024
1 check passed
@slawkens
Copy link
Owner

slawkens commented Jan 1, 2024

Ye that seems the correct approach for that notice.

I will accept that. Thanks for the PR!

Would be nice if you could do the same for the develop branch, if you don't mind :)

#edit

Nvm, I cherry-picked it to develop branch.

slawkens pushed a commit that referenced this pull request Jan 1, 2024
@danilopucci danilopucci deleted the bugfix/install-flush-error branch January 2, 2024 02:32
danilopucci added a commit to danilopucci/myaac that referenced this pull request Jan 2, 2024
slawkens added a commit that referenced this pull request Jan 30, 2024
This works for both, when output_buffering is enabled, and disabled
slawkens added a commit that referenced this pull request Jan 30, 2024
This works for both, when output_buffering is enabled, and disabled
danilopucci pushed a commit to danilopucci/myaac that referenced this pull request May 27, 2024
…ing)

This works for both, when output_buffering is enabled, and disabled
danilopucci added a commit to danilopucci/myaac that referenced this pull request May 30, 2024
danilopucci pushed a commit to danilopucci/myaac that referenced this pull request May 30, 2024
…ing)

This works for both, when output_buffering is enabled, and disabled
danilopucci pushed a commit to danilopucci/myaac that referenced this pull request May 30, 2024
…ing)

This works for both, when output_buffering is enabled, and disabled
danilopucci added a commit to danilopucci/myaac that referenced this pull request May 30, 2024
* Update common.php

* Create SECURITY.md

* Adding .env support (slawkens#1)

* - adding composer

* - adding .env support

* Revert "Adding .env support (slawkens#1)"

This reverts commit 79c570c.

* Cleanup install folder (slawkens#7)

* Adding .env support  (slawkens#2)

* - adding composer

* - adding .env support

* Improve DotEnv and fix e-mail settings  (slawkens#3)

* - revert changes on config.php, add config.local.php

* - adding missing account e-mails settings

* - adding check before flush buffer (slawkens#4)

* - raw import myaac-gesior-shop-system-v5.0-beta.2

* Fresh install (slawkens#5)

* - adding hidden ids

* - hiding template

* - removing katherine template

* - moving game server files to a specific folder

* Revert "Cleanup install folder (slawkens#7)"

This reverts commit e8693bc.

* Silently ignore if the hook does not exist

* - adding check before flush buffer (slawkens#245)

* Fix installation

* Remove 31.php migration -> was for develop branch

* Seems that this is better solution to the slawkens#245 (output buffering)

This works for both, when output_buffering is enabled, and disabled

* Fix broken installation I introduced in 0.8.15

* Revert "Fix installation"

This reverts commit 9c318f9.

* Release v0.8.16

* Fix date

---------

Co-authored-by: slawkens <slawkens@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants