Skip to content

Removed dependencies on "umbracoFile"#4

Open
bowserm wants to merge 14 commits intoAliSheikhTaheri:masterfrom
bowserm:master
Open

Removed dependencies on "umbracoFile"#4
bowserm wants to merge 14 commits intoAliSheikhTaheri:masterfrom
bowserm:master

Conversation

@bowserm
Copy link
Copy Markdown
Contributor

@bowserm bowserm commented Apr 28, 2015

Removed logic that depended on "umbracoFile" from the Conveyor core and into the DataTypeConverters. Added an UploadDataTypeConverter

@bowserm
Copy link
Copy Markdown
Contributor Author

bowserm commented Apr 28, 2015

I have tested this on umb v7.2.8. I haven't tested the v6 version, yet. There could potentially be some problems with the RTE import on v6... I may not have parsed through the umbracoSettings.config file correctly.

Basically, I pulled out all references to "umbracoFile". Instead, I added a UploadDataTypeConverter. I listed it as a Special DatatType in the config. Its export and import methods handle some of the logic that used to get handled in the conveyor core. To get everything working, I made the core dependent on an XML Attribute called "dependentAsset". I'm not sure how we should document this, but you can see that I tacked on a dependentAsset attribute in the UploadDataTypeConverter and the core pulls the media path out by referencing that.

@bowserm
Copy link
Copy Markdown
Contributor Author

bowserm commented Apr 28, 2015

Hmmmmm. This isn't quite perfect, yet. I'm going to need to refactor the RTE data type converter to be able to handle more generic upload properties like ImageCropper that stores JSON. It works for the Umbraco Upload property though

@bowserm
Copy link
Copy Markdown
Contributor Author

bowserm commented Apr 29, 2015

I finished implementing the ImageCropper data type converter. I've worked on the RTEDataTypeConverter, so that it can handle media via any data type. It leverages the DataTypeConverters for how to retrieve the media url from the media. The DataTypeConverters that the RTE can handle should implement the IUploadDataTypeConverter interface.

I still need to figure out how to get the RTE media on the anchor tags to import for image cropper. I believe this pull request has the image on the anchor tags broken no matter what, so maybe this pull request shouldn't be merged yet. It is up to you.

There is an umbraco bug that I have reported where the Services.MediaService.GetMediaByPath(...) method doesn't work if someone has put media in a different property than umbracoFile and also if they don't use the default UmbracoUpload data type for media.

@bowserm
Copy link
Copy Markdown
Contributor Author

bowserm commented Apr 29, 2015

I fixed the Rte data type converter's anchor tag method, so it works on default upload but not on image cropper. Can't figure out how to get media by path without the rel being inserted into the markup on anchor tag or when the umbraco bug where getmediabypath doesn't work when imagecropper is used.

I haven't tested anything on v6, yet, but it should at least be close

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