London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Hi Jonas,
I believe this was reported as a bug previously Bug - CMS-11522 (optimizely.com)
However I see you are on a later version.
There is also a support document that describe similar behaviour are these useful 409 conflict Creating page/block – Support Help Center (optimizely.com)?
Paul
Hi Jonas
To further build upon Paul answer, one soloution is to only change the behavior for request when in editmode like this.
<location path="Path/to/your/editAdmin">
<system.webServer>
<httpErrors errorMode="DetailedLocalOnly" existingResponse="Auto" />
</system.webServer>
</location>
public class MyBlockValidator : IValidate<MyBlock> { public IEnumerable<ValidationError> Validate(MyBlock instance) { if (instance.ImageContainer?.Image != null && (!string.IsNullOrEmpty(instance.VideoUrl) || instance.Screen9Video != null)) { yield return new ValidationError { ErrorMessage = LocalizationService.Current.GetString(Global.LocalizationStringKeys.Validation.VideoAndImageNotAllowed), Severity = ValidationErrorSeverity.Error, ValidationType = ValidationErrorType.Unspecified, PropertyName = nameof(MyBlock.ImageContainer), RelatedProperties = new[] { nameof(MyBlock.VideoUrl), nameof(MyBlock.Screen9Video) } }; } if ((instance.Screen9Video != null || !string.IsNullOrEmpty(instance.VideoUrl)) && string.IsNullOrWhiteSpace(instance.VideoTitle)) { yield return new ValidationError { ErrorMessage = LocalizationService.Current.GetString(Global.LocalizationStringKeys.Validation.VideoTitleMissing), Severity = ValidationErrorSeverity.Error, ValidationType = ValidationErrorType.Unspecified, PropertyName = nameof(MyBlock.VideoTitle), RelatedProperties = new[] { nameof(MyBlock.VideoUrl), nameof(MyBlock.Screen9Video) } }; } yield break; } }
Having implemented validation on a block works when editing an existing block but breaks on new block
Dojo gets status 409 "The page was not displayed because there was a conflict"
Any ideas on why?