GithubHelp home page GithubHelp logo

Comments (6)

kjac avatar kjac commented on June 15, 2024

Hmmm... been digging into this a bit.

The Umbraco FileUploadPropertyValueEditor's ConvertEditorToDb() method expects a "files" collection in editorValue.AdditionalData (https://github.com/umbraco/Umbraco-CMS/blob/7.1.2/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs#L87) which apparently isn't supplied to Archetype's ArcheTypePropertyEditor ConvertEditorToDb() method (https://github.com/imulus/Archetype/blob/master/app/Umbraco/Umbraco.Archetype/PropertyEditors/ArcheTypePropertyEditor.cs#L114).

It looks like the trouble starts on the client with the fileUploadController's "filesSelected"-event not being fired (https://github.com/umbraco/Umbraco-CMS/blob/7.1.2/src/Umbraco.Web.UI.Client/src/views/propertyeditors/fileupload/fileupload.controller.js#L84). This event handler is supposed to call fileManager.setFiles() (https://github.com/umbraco/Umbraco-CMS/blob/7.1.2/src/Umbraco.Web.UI.Client/src/common/services/filemanager.service.js#L26) to save the selected files in scope. Upon save/publish, the ContentEditController's performSave() method (https://github.com/umbraco/Umbraco-CMS/blob/7.1.2/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js#L149) is called, which in turn calls fileManager.getFiles() to fetch the files saved on scope. Ultimately this leads to contentResource.saveContentItem() (https://github.com/umbraco/Umbraco-CMS/blob/7.1.2/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js#L29) being called with an empty files collection.

I dunno... does it make sense?

from archetype.

AussieInSeattle avatar AussieInSeattle commented on June 15, 2024

Makes sense in respect to it not working :-).

You got a lot further than me in debugging to get to the "why" - so does this essentially mean it is an Umbraco issue that we'll need to wait to have them fix? Or is it an issue with Archetype?

If its an Umbraco issue or if your fix will take a while then I need to explore other avenues for the property editor experience (this is for a site launching on May 15th). One option I am looking at is to implement my own file upload PE that plays nicely with Archetype - sounds like that would potentially fix the issue?

Regards,
Matt

from archetype.

kjac avatar kjac commented on June 15, 2024

No... I think it's an Archetype issue. Maybe some wiring up of things that doesn't get done or doesn't work when wrapping the PE in the Archetype fieldset.
@kgiszewski do you have any idea? Is this isolated to the Upload PE or could Archetype have a more general problem with PE's that rely on $scope.$on(...) to work?

from archetype.

kgiszewski avatar kgiszewski commented on June 15, 2024

The only two core property editors that we have issues with is Upload and Image Cropper. I haven't had a chance to track down what is happening, but I suspect an event is not being fired or something is getting missed on page reload.

The present work around is to avoid upload/image cropper in Archetype directly. Rather use a media picker/MNTP instead. If you want to use the image cropper, it can replace the upload field on the image media type directly.

from archetype.

AussieInSeattle avatar AussieInSeattle commented on June 15, 2024

No worries - the work-around you mentioned works for me!

from archetype.

kgiszewski avatar kgiszewski commented on June 15, 2024

Fixed in #281

from archetype.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.