Skip to content

Handle long URLs #52

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

andrewhancox
Copy link

As outlined in issue 50:
Moodle file names should not be more than 255 characters, but the filter_imageopt table only allows 255 for the urlpath (filename+other elements). This means that any file name over ~230 characters (substantially less if it contains characters that require urlencoding) prevents the page from rendering.
In order to allow for this situation I have changed the fieldtype to text, this meant I had to drop the unique index on url path as this is not supported on this column type.
To accommodate dropping the index:
I made the add_url_path_to_queue function ignore multiple records as in theory on high traffic sites that could be the case. Multiple rows will not cause an issue though as they will still get mopped up in the normal way by the delete_queue_item_by_path function.
The filter_imageopt table never gets cleared out so large sites can end up with a significant number of entries that were created for images that never ended up being loaded. This would not have been an issue with the unique index in place but without it there is a potential storage issue (the client I'm working with has 14k rows in this table). To mitigate this I now remove all entries over 12 months old.

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.

1 participant