BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

Issue when updating Bookstack

Open fiphi opened this issue 1 year ago • 5 comments

Describe the Bug

Actual version : BookStack v23.06.2 Trying to update to the latest version: => git pull origin release return this : On branch release Your branch is behind 'origin/release' by 304 commits, and can be fast-forwarded. (use "git pull" to update your local branch)

Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: .env.example modified: .env.example.complete modified: .gitattributes modified: .github/CODE_OF_CONDUCT.md modified: .github/FUNDING.yml modified: .github/ISSUE_TEMPLATE/api_request.yml modified: .github/ISSUE_TEMPLATE/bug_report.yml modified: .github/ISSUE_TEMPLATE/config.yml modified: .github/ISSUE_TEMPLATE/feature_request.yml etc... Already checks done on other issue I have done this: git config core.fileMode false Then it returns : On branch release Your branch is behind 'origin/release' by 304 commits, and can be fast-forwarded. (use "git pull" to update your local branch)

Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: resources/views/common/footer.blade.php

Untracked files: (use "git add ..." to include in what will be committed) bookstack-files-backup.tar.gz

no changes added to commit (use "git add" and/or "git commit -a") I have tried : git restore resources/views/common/footer.blade.php Then : git pull origin release composer install --no-dev php artisan migrate Everything seems to be OK BUT when relaunching the app: 06-02-2024 08-26-05 So, I can NOT do the update ! Anyone has an idea what it is wrong here ? Thx for feedback/info on this topic.

Steps to Reproduce

See above description

Expected Behaviour

See above description

Screenshots or Additional Context

See above

Browser Details

linux redhat 9.2

Exact BookStack Version

V23.06.2

fiphi avatar Feb 06 '24 07:02 fiphi

Hi @fiphi, Running from your BookStack install directory, can you share the output of running the following?:

php artisan tinker --execute="echo print_r(\BookStack\Settings\Setting::where('setting_key', 'app-footer-links')->first()->toArray());"

ssddanbrown avatar Feb 06 '24 12:02 ssddanbrown

Thx for your update on this topic, but found the issue in a php file: cat /var/www/BookStack/resources/views/common/footer.blade.php @if(empty(setting('app-footer-links', [])) > 0) => replace of count() bye empty solve this issue.. Didi you have any clue about this ?

fiphi avatar Feb 06 '24 13:02 fiphi

Hi @fiphi, I'm not convinced the issue is with the template itself, since I have not seen this issue elsewhere and since you had previous changes to the footer template, which indicates there may be something non-standard/common in your specific environment.

Your change above is working around the issue, but not reflecting the underlying issue/cause. Please can you run the command from my last comment and share the output?

ssddanbrown avatar Feb 06 '24 14:02 ssddanbrown

Hi,

Here it is : Array ( [setting_key] => 0 [value] => [] [created_at] => 2021-09-17T08:36:20.000000Z [updated_at] => 2021-09-17T08:36:20.000000Z [type] => string ) 1

fiphi avatar Feb 06 '24 14:02 fiphi

@fiphi Okay, strange, not sure how it got to that type. From your BookStack install directory, run the following:

php artisan tinker --execute="\BookStack\Settings\Setting::where('setting_key', 'app-footer-links')->update(['type' => 'array']);"

That should change the setting back to expected, then you can revert any custom changes to the view files to avoid update compatibility issues in future.

ssddanbrown avatar Feb 06 '24 14:02 ssddanbrown

Since there's been no further follow-up on this issue I'll close this off.

ssddanbrown avatar Apr 16 '24 13:04 ssddanbrown