Fixes the media refs within the RTE in the Grid #6554
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is sort of a regression from 8.1 where when we updated the media references within the RTE, the values would be persisted with UDI references and without the actual media paths.
Unfortunately the code for the Grid's RTE's was not updated so this never took place for the Grid.
The images stored in the DB should look something like this within the html:
But for the grid rte it would still maintain the path:
When the RTE is re-rendered in the back office, the
src
attribute is then re-updated with the correct media path. This was also not happening in the Grid's RTE.This PR fixes this issue so now the RTE and the Grid RTE behave the same way.
You can test this by:
Inserting an image into a normal RTE and save/publish, go check your DB:
You'll be able to find your value near the top of this list in the
textValue
and it should have asrc
attribute without the media pathAnd of course in the back office the image should still render just fine.
Then perform the same test with the Grid's RTE. The behavior should be the same.