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

missing arrow svg icons, breaking collectstatic if ManifestStaticFilesStorage is used #48

Open
jorenham opened this issue Jan 7, 2025 · 2 comments

Comments

@jorenham
Copy link
Contributor

jorenham commented Jan 7, 2025

These icons .svg don't exist in the wagtail_hallo static dir on 0.6.0:

.icon-arrow-down-after:after {
mask-image: url('../images/icons/arrow-down.svg');
}
.icon-arrow-down-after:after,
.icon-arrow-right-after:after {
background-color: currentColor;
content: '';
display: inline-block;
height: 1em;
width: 1em;
}
.icon-arrow-right-after:after {
mask-image: url('../images/icons/arrow-right.svg');
}
.icon-arrow-up-after:after {
background-color: currentColor;
content: '';
display: inline-block;
height: 1em;
mask-image: url('../images/icons/arrow-up.svg');
width: 1em;
}

I believe they do exist in wagtailadmin, so they could be copied over, or the paths could be changed to refer to the ones in wagtailadmin/ instead of wagtail_hallo/.


This seems like a low-prio issue, but in my case it crashed my production server 😅.
The reason for this, is because we use django.contrib.staticfiles.storage.ManifestStaticFilesStorage as staticfiles storage. So when manage.py collectstatic is called (e.g. on deployment), this is the result:

web_master       | Post-processing 'css/icons.css' failed!
web_master       | 
web_master       | Traceback (most recent call last):
web_master       |   File "/src/manage.py", line 11, in <module>
web_master       |     execute_from_command_line(sys.argv)
web_master       |     ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
web_master       |   File "/usr/local/lib/python3.13/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
web_master       |     utility.execute()
web_master       |     ~~~~~~~~~~~~~~~^^
web_master       |   File "/usr/local/lib/python3.13/site-packages/django/core/management/__init__.py", line 436, in execute
web_master       |     self.fetch_command(subcommand).run_from_argv(self.argv)
web_master       |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
web_master       |   File "/usr/local/lib/python3.13/site-packages/django/core/management/base.py", line 413, in run_from_argv
web_master       |     self.execute(*args, **cmd_options)
web_master       |     ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
web_master       |   File "/usr/local/lib/python3.13/site-packages/django/core/management/base.py", line 459, in execute
web_master       |     output = self.handle(*args, **options)
web_master       |   File "/usr/local/lib/python3.13/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 209, in handle
web_master       |     collected = self.collect()
web_master       |   File "/usr/local/lib/python3.13/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 154, in collect
web_master       |     raise processed
web_master       |   File "/usr/local/lib/python3.13/site-packages/django/contrib/staticfiles/storage.py", line 375, in _post_process
web_master       |     content = pattern.sub(converter, content)
web_master       |   File "/usr/local/lib/python3.13/site-packages/django/contrib/staticfiles/storage.py", line 249, in converter
web_master       |     hashed_url = self._url(
web_master       |         self._stored_name,
web_master       |     ...<2 lines>...
web_master       |         hashed_files=hashed_files,
web_master       |     )
web_master       |   File "/usr/local/lib/python3.13/site-packages/django/contrib/staticfiles/storage.py", line 182, in _url
web_master       |     hashed_name = hashed_name_func(*args)
web_master       |   File "/usr/local/lib/python3.13/site-packages/django/contrib/staticfiles/storage.py", line 425, in _stored_name
web_master       |     cache_name = self.clean_name(self.hashed_name(name))
web_master       |                                  ~~~~~~~~~~~~~~~~^^^^^^
web_master       |   File "/usr/local/lib/python3.13/site-packages/django/contrib/staticfiles/storage.py", line 143, in hashed_name
web_master       |     raise ValueError(
web_master       |         "The file '%s' could not be found with %r." % (filename, self)
web_master       |     )
web_master       | ValueError: The file 'images/icons/arrow-down.svg' could not be found with <django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at 0x7f1a955c1550>.
web_master       | Sentry is attempting to send 2 pending events
web_master       | Waiting up to 2 seconds
web_master       | Press Ctrl-C to quit
@jorenham
Copy link
Contributor Author

jorenham commented Jan 7, 2025

as a workaround I copied the wagtail/admin/static/wagtailadmin/images/icons directory to static/images/icons of my own project

@jorenham
Copy link
Contributor Author

jorenham commented Jan 7, 2025

I used this as an opportunity to (finally) migrate to draftail. It was actually way easier than I anticipated.

Anyway, thanks for all of your work on this transitional package!

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

No branches or pull requests

1 participant