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

Report template types are broken #436

Closed
smcgu opened this issue May 16, 2024 · 5 comments
Closed

Report template types are broken #436

smcgu opened this issue May 16, 2024 · 5 comments
Assignees
Labels
bug Something isn't working stale

Comments

@smcgu
Copy link
Contributor

smcgu commented May 16, 2024

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:

  1. Go to Report Template Library -> DOCX templates show the PowerPoint icon
  2. Click on a template -> The "PowerPoint" badge is visible under the template name
  3. Edit the template
  4. 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.

@smcgu smcgu added the bug Something isn't working label May 16, 2024
@chrismaddalena
Copy link
Collaborator

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.

@smcgu
Copy link
Contributor Author

smcgu commented May 16, 2024

Thank you for the quick response. The containers were rebuilt and I tested the process twice. The process was:

  1. git pull
  2. git switch v4-1-dev
  3. git log # to verify latest commits
  4. ./ghostwriter-cli-linux containers down
  5. ./ghostwriter-cli-linux containers build
  6. ./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.

@chrismaddalena
Copy link
Collaborator

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

Copy link

This issue has been labeled as stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Jun 16, 2024
Copy link

github-actions bot commented Jul 1, 2024

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.

@github-actions github-actions bot closed this as completed Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants