kgiszewski / Archetype

Archetype is an Umbraco 7 property editor that wraps other installed property editors.
https://github.com/kgiszewski/ArchetypeManual
MIT License
89 stars 54 forks source link

Unable to pick images after 7.6.0 update. #397

Closed honzabilek4 closed 7 years ago

honzabilek4 commented 7 years ago

Hi, Neither ImageCropper nor MediaPicker property editors are working in latest Umbraco 7.6.0, therefore we cannot use images as properties. MediaPicker doesn't show up at all. ImageCropper is not saving images. I guess the update will be affecting more property editors than only these two. (I haven't tried them yet.) Please try to look in to it. I can provide more info if needed, however this should be easily reproducible. Thank you!

kgiszewski commented 7 years ago

Hi Jan,

Unfortunately there are a few changes in v7.6 core that are causing this issue it seems. I won't be able to offer a quick fix to this as I'm currently out of the Umbraco game.

If staying at a lower core version is an option, I would recommend that at this time.

The Umbraco core team doesn't support third-party addins like Archetype nor is this project funded. Bug fixes generally get done by me, other core team members (on a volunteer basis) or other community members.

I've gone ahead and tweeted out this issue as it would probably affect many folks. Perhaps we'll get someone to assist us.

You may also try the forums on Our.Umbraco.org

Regards,

Kevin

kjac commented 7 years ago

I'll start digging into this in the near future. I might need to bump the Umbraco version dependency to fix it, time will tell.

TErenberger commented 7 years ago

I'm having a similar issue after updating to umbraco 7.6.3. We had an archetype that was already using a media picker (now obsolete) and had been functioning prior to the update.

The problem is that we started to get exceptions thrown on ArchetypeFieldsetModel.GetValue[T](String propertyAlias) calls for a property that is a media picker.

The full stack trace is:

   String "1187" is not a valid udi.  
   at Umbraco.Core.Udi.ParseInternal(String s, Boolean tryParse, Udi& udi)
   at Umbraco.Core.Udi.Parse(String s)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Umbraco.Web.PropertyEditors.ValueConverters.MediaPickerPropertyConverter.ConvertDataToSource(PublishedPropertyType propertyType, Object source, Boolean preview)
   at Archetype.Models.ArchetypePropertyModel.TryConvertWithPropertyValueConverters[T](Object value, IEnumerable`1 converters)
   at Archetype.Models.ArchetypePropertyModel.GetValue[T]()
   at Archetype.Models.ArchetypeFieldsetModel.GetValue[T](String propertyAlias)
   at Backend.Core.Extensions.ArchetypeFieldsetModelExtensions.GetImage(ArchetypeFieldsetModel model, String propertyName, IUmbracoHelper umbracoHelper) in C:\Development\Source\Intranet-Project\merged2\Umbraco\Backend\Core\Extensions\ArchetypeFieldsetModelExtensions.cs:line 11
   at Backend.Models.ViewModels.ArchetypeFieldsetViewModels.EnrichedMediaItemViewModel..ctor(ArchetypeFieldsetModel overlayTextsModel, ArchetypeFieldsetModel mediaItemsModel, IUmbracoHelper umbraco) in C:\Development\Source\Intranet-Project\merged2\Umbraco\Backend\Models\ViewModels\ArchetypeFieldsetViewModels\EnrichedMediaItemViewModel.cs:line 21
   at Backend.Core.Extensions.IUmbracoHelperExtensions.GetNewsArticleMediaItems(IUmbracoHelper umbraco, NewsArticle article, CultureInfo selectedCulture) in C:\Development\Source\Intranet-Project\merged2\Umbraco\Backend\Core\Extensions\IUmbracoHelperExtensions.cs:line 93 

I tried changing the media picker (obsolete) to the media picker2 type and to repick the image but did not find any success.

I was able to work around the exception by looping over the properties and grabbing the value directly.

Hopefully this helps in some way!

Note: this is with the new property value converters enabled.

In UmbracoSettings.config:

<!-- Enables value converters for all built in property editors so that they return strongly typed object, recommended for use with Models Builder -->
    <EnablePropertyValueConverters>true</EnablePropertyValueConverters>
kjac commented 7 years ago

@TErenberger if I'm reading the upgrade notes correctly (check this page in the section "Upgrading"), you should not enable the property value converters when upgrading from a site version prior to 7.6 - it breaks pickers among other things.

I've got a working solution for a newly created 7.6 site, will update this issue as the testing progresses.

TErenberger commented 7 years ago

@kjac We had some issues initially, but we were able to update the get value calls that returned different types with that option enabled. After those updates we haven't run into any issues with that option enabled (except with archetype + media picker).

Looking forward to your solution!

kjac commented 7 years ago

401 fixes this issue. We'll keep the issue open until a new release is ready.

kjac commented 7 years ago

Fixed in v1.14.1