Activities of "nick.coleman"

@gterdem

Thanks you for your help!

This is now working....

This was the key part

OneTimeRunner.Run(() => { ObjectExtensionManager.Instance .MapEfCoreProperty<IdentityUser, Title>( "Title", (entityBuilder, propertyBuilder) => { propertyBuilder.HasConversion<string>(); // If you want your Title to be seen as string } ); });

Hi,

Thanks for the quick response... Im not replacing the UI.

I think it maybe due to the way i have the value configured in the DB? The modal works when the title is null in the DB but as soon as i save a user with a value for 'Title' field i can no longer open the modal for that user and i receive the error above.

Here is the EF configuration ; ObjectExtensionManager.Instance .MapEfCoreProperty<IdentityUser, string>( UserConsts.TitleName, (entityBuilder, propertyBuilder) => { propertyBuilder.HasMaxLength(UserConsts.TitleLength); } );

Does this look ok?

I can actually create users fine, I have managed to create users but as soon as i try and edit them i get the error... are you able to try this in your example?

Thanks

nick

Hi,

Thanks but this doesn't compile for me?.

Invalid expression term 'enum'

Thanks

Nick

Did I ask this question incorrectly?

If there is no answer to this can you close so I can claim my question back please

  • ABP Framework version: v4.2.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi,

I am extending the IdentityUser Object to add some custom properties and have successfully added a few following the advice here:

https://docs.abp.io/en/abp/latest/Module-Entity-Extensions https://community.abp.io/articles/how-to-add-custom-property-to-the-user-entity-6ggxiddr

However I hit a problem If I want to add a property of type Enum, for example :

 user.AddOrUpdateProperty<Title>(
                      UserConsts.TitleName,
                      options =>
                      {
                          options.Attributes.Add(new RequiredAttribute());
                          options.UI.OnTable.IsVisible = false; 
                      }
                    );

where 'Title' is the Enum :

 public enum Title
    {
        Mr = 0,
        Mrs = 1,
        Ms = 2,
        Dr = 2
    }

When creating the UI to manage the user I get the following error...

    An unhandled exception occurred while processing the request.
Exception: No items provided for select attribute.
Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form.AbpSelectTagHelperService.GetSelectItems(TagHelperContext context, TagHelperOutput output)

How do I instruct the UI to get the select elements from the values of the Enum?

Many Thanks

fixed using this

https://github.com/abpframework/abp/issues/6473

while my above statement is correct it seems this is created by aclient side script error

tui-editor-Editor.min.js?_v=637436356634702071:formatted:3263 Uncaught TypeError: Cannot read property 'msie' of undefined

on this line

var isIE10 = _tuiCodeSnippet2.default.browser.msie && _tuiCodeSnippet2.default.browser.version === 10;

This stops the content editor being displayed and therefore populated

An issue with tui-editor?

Anyone have any ideas?

I think i have discoved the issue...

The New.cshtml Page in the Posts Directory uses this model

public class CreatePostViewModel { ... [HiddenInput] [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxContentLength))] public string Content { get; set; } .... }

This is then mapped to CreatePostDto

public class CreatePostDto { [Required] [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxContentLength))] public string Content { get; set; } }

The validation fails as there 'Content' is null due to it being hidden in the UI (there is no chance to enter content) and it is required on the CreatePostDto.

Does this sound correct? It just seems strange as this is kind of fundamental - to be able to add content to a blog post so it makes me think i have something wrong here?

The blog module does not appear to work - creating a post does not work

  • ABP Framework version: v4.0.1
  • UI type: MVC
  • Tiered (MVC) or Identity Server Seperated (Angular): no
  • Exception message and stack trace:

AbpValidationException: Method arguments are not valid! See ValidationErrors for details. Volo.Abp.Validation.MethodInvocationValidator.ThrowValidationError(MethodInvocationValidationContext context) Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter<TInterceptor>.InterceptAsync<TResult>(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func<IInvocation, IInvocationProceedInfo, Task<TResult>> proceed) Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous<TResult>(IInvocation invocation, IInvocationProceedInfo proceedInfo) Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue<TResult>.ProceedAsync() Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter<TInterceptor>.InterceptAsync<TResult>(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func<IInvocation, IInvocationProceedInfo, Task<TResult>> proceed) Volo.Blogging.Pages.Blog.Posts.NewModel.OnPost() Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory+GenericTaskHandlerMethod.Convert<T>(object taskAsObject) Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory+GenericTaskHandlerMethod.Execute(object receiver, object[] arguments) Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync() Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync() Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context) Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events, IBackChannelLogoutService backChannelLogoutService) IdentityServer4.Hosting.MutualTlsEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes) Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context) Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Microsoft.AspNetCore.Builder.ApplicationBuilderAbpJwtTokenMiddlewareExtension+<>c__DisplayClass0_0+<<UseJwtTokenMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

  • Steps to reproduce the issue:

1 - Open ABP Suite 2 - Create New MVC/EF Core Solution 3 - Add Blogging Module 4 - Open Visual Studio 5 - Add Migration 6 - Run DbMigrator Project 7 - Run Web Project 8 - Login as Admin 9 - Create New Blog with shortname 'test-blog' 10 - visit '/blog/test-blog' 11 - click 'create new post' 12 - fill in all information in form including an image 13 - click 'create post'

Showing 1 to 9 of 9 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11