Skip to content

fix modulo mime_type for file#319

Merged
TheSaintSimon merged 15 commits intomainfrom
modulo-file-index
Apr 3, 2026
Merged

fix modulo mime_type for file#319
TheSaintSimon merged 15 commits intomainfrom
modulo-file-index

Conversation

@TheSaintSimon
Copy link
Copy Markdown
Contributor

@TheSaintSimon TheSaintSimon commented Mar 6, 2026

This PR updates Modulo MIME type data and refreshes enhanced link metadata during the upgrade, so links to Modulo files show the correct file type instead of stale values like TXT.

@TheSaintSimon TheSaintSimon self-assigned this Mar 6, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 6, 2026

Pull Request Test Coverage Report for Build 23942034117

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 68.901%

Totals Coverage Status
Change from base Build 21474360674: 0.04%
Covered Lines: 3403
Relevant Lines: 4939

💛 - Coveralls

@TheSaintSimon TheSaintSimon marked this pull request as ready for review March 9, 2026 16:19
Comment thread src/design/plone/contenttypes/upgrades/to_730x.py Outdated
Comment thread src/design/plone/contenttypes/upgrades/to_730x.py Outdated

def refresh_module_links(blocks, url):
for block in blocks.values():
if block.get("@type", "") != "slate":
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are a LOT of other blocks that have slate inside some fields

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it could be better to iterate over tool keys and if is a Module, then force re-generate it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simpified it.
Now it iterates over the enhanced links tool keys and force refreshes only entries whose target is a Modulo

@cekk
Copy link
Copy Markdown
Member

cekk commented Mar 9, 2026

And add CHANGELOG please

@cekk
Copy link
Copy Markdown
Member

cekk commented Mar 9, 2026

It will be great also if you could provide a test

@mamico

This comment was marked as resolved.

@TheSaintSimon
Copy link
Copy Markdown
Contributor Author

And add CHANGELOG please

It will be great also if you could provide a test

Added CHANGELOG and 2 test

@TheSaintSimon TheSaintSimon requested a review from cekk March 11, 2026 08:57
Copy link
Copy Markdown
Member

@luca-bellenghi luca-bellenghi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In generale mi pare andar bene.
@cekk una verifica per te che conosci meglio il tool. Ma mi pare che ci siamo

Comment thread src/design/plone/contenttypes/upgrades/to_730x.py
Comment thread src/design/plone/contenttypes/tests/test_modulo_mime_type.py Outdated
Comment thread src/design/plone/contenttypes/tests/test_modulo_mime_type.py Outdated
Comment thread src/design/plone/contenttypes/upgrades/to_730x.py
Comment thread CHANGES.rst Outdated
@TheSaintSimon TheSaintSimon requested a review from cekk March 31, 2026 07:59
Copy link
Copy Markdown
Member

@cekk cekk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dai che ci siamo quasi

Comment thread src/design/plone/contenttypes/tests/test_modulo_mime_type.py
Comment thread CHANGES.rst Outdated
-------------------

- Nothing changed yet.
- Fixed file type shown for links to Modulo files.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e che file type ci mette? Quello del file principale? L'entry nel changelog serve per capire cosa è cambiato, e più informazioni dai, meglio è. Poi la modifica in generale non è quella, ma che viene indicizzato il mime_type come quello del file principale..che poi venga usato in enhancedlinks è una cosa secondaria

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aggiornato

@TheSaintSimon TheSaintSimon requested a review from cekk April 3, 2026 12:20
@TheSaintSimon TheSaintSimon merged commit c8e37e3 into main Apr 3, 2026
12 checks passed
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.

5 participants