block list editor No argument found for the current action with the name: id
Ive created a block list editor
I keep getting the following when I open it
No argument found for the current action with the name: id
Exception Details
System.InvalidOperationException: No argument found for the current action with the name: id
at
Umbraco.Web.WebApi.Filters.EnsureUserPermissionForMediaAttribute.OnActionExecuting(HttpActionContext actionContext) in D:\a\1\s\src\Umbraco.Web\WebApi\Filters\EnsureUserPermissionForMediaAttribute.cs:line 112
at System.Web.Http.Filters.ActionFilterAttribute.OnActionExecutingAsync(HttpActionContext actionContext, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
Eg opening a content item that has the Block List Editor on
or when opening the Block List Editor to choose a block
or are you rendering the blocks 'inline' like Nested Content
or is it displayed when you choose a type of block and are about to enter data?
Does the ElementType that describes your Block List Editor block contain a Media Picker?
and if so does that Media Picker have a configured 'start node'?
The error looks like a bug - it's basically not able to get the id of a media item in order to check whether the current user has permissions to view/pick it... but that seems bizarre, and so the answers to the above may give a clue as to where to start looking
Hi Mark
Literally, go to add the block to the block list it throws this error.
The block contains two media pickers, two textboxes nothing overly major. It renders fine other than this error popping up.
Yes, so it seems when an image is not set, there is a check being requested to see if the current user has access to that image 'or not'.
I've just installed a fresh copy of Umbraco 8.12.2
And set up your scenario, just to see if I can see something going wrong.
But I can't make it happen.
But I am logged in as an Admin, and don't have any start node restrictions - what is your scenario?
Also which version of Umbraco are you using?
Also did you update the Element Type, after creating some of the blocks initially? - eg does deleting all the blocks, saving, and reloading the backoffice page, mean that new blocks do not trigger the issue..
Finally, do you have a custom view with the block? and is that trying to get the image back from the picker, and so is trying to do so when an image isn't picked?
Have just created a brand new block but the issue remains. I actually moved the images out to the settings - as this is possible a better location for them long term. I do a null check in the controller.
Ahh, I think that makes more sense, I think it's the getById of the MediaResource that will trigger the check to see if the current user has permissions to access that id. (you could comment it out temporarily to confirm)
My guess here is that perhaps $scope.block.settingsData.backgroundImage isn't null, but is instead 0 or an empty string ? when an image isn't picked?
You could use console.log() to see what the value is when the null check is being made, I did something recently in a custom block list editor view for a content picker:
block list editor No argument found for the current action with the name: id
Ive created a block list editor
I keep getting the following when I open it
No argument found for the current action with the name: id
Exception Details System.InvalidOperationException: No argument found for the current action with the name: id
at
Hi Lori
At what point is this mysterious error thrown?
Eg opening a content item that has the Block List Editor on
or when opening the Block List Editor to choose a block
or are you rendering the blocks 'inline' like Nested Content
or is it displayed when you choose a type of block and are about to enter data?
Does the ElementType that describes your Block List Editor block contain a Media Picker?
and if so does that Media Picker have a configured 'start node'?
The error looks like a bug - it's basically not able to get the id of a media item in order to check whether the current user has permissions to view/pick it... but that seems bizarre, and so the answers to the above may give a clue as to where to start looking
regards
marc
Hi Mark Literally, go to add the block to the block list it throws this error. The block contains two media pickers, two textboxes nothing overly major. It renders fine other than this error popping up.
I try add a start node to the media picker
Live editing mode is enabled.
When the images are set doesnt seem to happen
Hi Lori
Yes, so it seems when an image is not set, there is a check being requested to see if the current user has access to that image 'or not'.
I've just installed a fresh copy of Umbraco 8.12.2
And set up your scenario, just to see if I can see something going wrong.
But I can't make it happen.
But I am logged in as an Admin, and don't have any start node restrictions - what is your scenario?
Also which version of Umbraco are you using?
Also did you update the Element Type, after creating some of the blocks initially? - eg does deleting all the blocks, saving, and reloading the backoffice page, mean that new blocks do not trigger the issue..
Finally, do you have a custom view with the block? and is that trying to get the image back from the picker, and so is trying to do so when an image isn't picked?
regards
marc
Hi I am logged in as an admin. Using Umbrao version 8.11.1
Followed the https://our.umbraco.com/documentation/getting-started/backoffice/property-editors/built-in-property-editors/Block-List-Editor/
Have just created a brand new block but the issue remains. I actually moved the images out to the settings - as this is possible a better location for them long term. I do a null check in the controller.
I do have a custom view.
My Controller
My View
Hi Lori
Ahh, I think that makes more sense, I think it's the getById of the MediaResource that will trigger the check to see if the current user has permissions to access that id. (you could comment it out temporarily to confirm)
My guess here is that perhaps $scope.block.settingsData.backgroundImage isn't null, but is instead 0 or an empty string ? when an image isn't picked?
You could use console.log() to see what the value is when the null check is being made, I did something recently in a custom block list editor view for a content picker:
http://tooorangey.co.uk/posts/editing-some-tabular-data-in-umbraco-v8/
and it looks like I ended up checking the 'length' of the value rather than trying to detect if it was null...
eg
so that might be worth a shout...
regards
Marc
Marc thank you so much for sticking with me - that was it
scope.block.settingsData.backgroundImage.length > 0
rather than null
Hurray!
is working on a reply...