There’s no entity in the context (i.e. ‘entity’: None)
I don’t understand why there’s no entity, as compared to the working example. I looked the doc but didn’t find an answer. Sorry if this is obvious.
So it shouldn’t have anything to do with the templates, the context_from_path doesn’t consider them. It’s based purely on the schema and the registered folders in the path cache.
I just tested here having the same Asset registered in two different locations and then trying to extract the context from both paths, and it worked for me.
So I wonder if there is something up with your registered paths. First I would make sure you run synchronize_filesystem_structure() before you attempt to call this, to make sure that the local path cache is in sync.
If that doesn’t work then we’ll need to take a look at your path cache/schema to try and figure whats going on.
And got the same result, no entity found. I’m going to look into my schema, thanks for pointing it out. I suspect it comes from an error there.
Btw, what’s the ‘path cache’ ? I understand ‘schema’ as the folder structure residing in config/core/schema, but I’m not sure to understand what you mean by ‘path cache’.
BTW, is there documentation about the way the context is built when using the context_from_path ? I searched but did not find information about this specifically.
Essentially the context_from_path method is looking up the path you provided in the path cache, which is a registry of path to entity associations. So if the path can’t be found/matched to entities in the path cache, then no context can be derived.
What you can check is that when you create the folders for your asset, that you get the appropriate FilesystemLocation entities created in Shotgun, ie each entity folder that should have been created in the schema gets an entity. Also list type folders are a bit special so they won’t be associated with an entity, but your Asset folder should.