Report template types are broken
Describe the bug
Report templates show the incorrect type and the Document Type drop-down has empty options.
To Reproduce
Steps to reproduce the behavior:
- Go to Report Template Library -> DOCX templates show the PowerPoint icon
- Click on a template -> The "PowerPoint" badge is visible under the template name
- Edit the template
- Expand the Document Type drop-down -> two empty selections and "Project DOCX"
Expected Behavior
Report templates should be correctly associated with their document type in the Report Template Library view and in an individual report template view.
Screenshots
Shared over Slack. Unable to upload here.
Server Specs:
- OS: Ubuntu 22.04
- Docker: Docker version 26.1.1, build 4cf5afa
- Docker Compose: Docker Compose version v2.27.0
- Ghostwriter: v4.2.0, released 15 May 2024
Additional context
Reverting to v4.1.0 (tag/release) resolved the behavior.
Hey @smcgu, it's best to use the code in main or the latest archive of the latest release. The v4.2 development branch is not ready for production use right now.
That said, it sounds like your database was not properly seeded after you updated. You need to re-build the containers to ensure the database has the proper default values. In this case, the values are the names of the document types. This is new in the upcoming v4.2 release. If the initial values aren't loaded, you'll see empty entries in the drop-down because the name values are missing. This also leads to incorrect icons displayed for docx and pptx templates on the template library page.
Thank you for the quick response. The containers were rebuilt and I tested the process twice. The process was:
-
git pull -
git switch v4-1-dev -
git log# to verify latest commits -
./ghostwriter-cli-linux containers down -
./ghostwriter-cli-linux containers build -
./ghostwriter-cli-linux containers up
The templates were properly listed and typed before this process. So, it is something in the upgrade process or changes.
And, yes, I am aware of that the dev branch is less stable. This was tested on a restricted, limited use installation.
Alex and I were just chatting and we found the issue. Ghostwriter CLI tries to not step on any database customizations you may have made. In this case, two of the three entries already exist and the new fixtures modify them. The build command skips loading the fixtures because the entries already exist. That's why you end up with blank name fields.
You can fix that manually with this command. We'll look at updating how we try to handle fixtures for the release.
docker compose -f production.yml run --rm django python manage.py loaddata --force ghostwriter/reporting/fixtures/initial.json
This issue has been labeled as stale because it has been open for 30 days with no activity.
This issue is closed because it has been inactive for 14 days since being labeled stale. Feel free to re-open the issue with a comment. If this needs further discussion (e.g., a feature request), it might be better to open a topic under the Discussions tab.