I’m working on an new package that will use attributes. So I’ve created all the necessary files and so on. But when I hit “install” the following error occurs:
Entity ‘Concrete\Package\MyPackage\Src\MyPackage\Entity\Attribute\Key\MyPackageKey’ has to be part of the discriminator map of ‘Concrete\Core\Entity\Attribute\Key\Key’ to be properly mapped in the inheritance hierarchy. Alternatively you can make ‘Concrete\Package\MyPackage\Src\MyPackage\Entity\Attribute\Key\MyPackageKey’ an abstract class to avoid this exception from occurring.
I’ve looked at other attribute keys like UserKey and so on, but I’ve the same entity (apart of the name) . And I don’t know what this could be.
I’ve seen this error occasionally, and it’s usually been on a site that has Community Store installed. I have got around it by clearing cache/rebuilding proxies etc, and sometimes it takes a few attempts to get it to fly. I believe it has something to do with the order in which packages are loaded. If this is a dev site, I’d be inclined to strip out any packages other than the one you’re working with and see if that resolves it.
Hi! Thanks. I’ve seen several posts about this issue in combination with Community Store, but I’m experiencing it without the store package. It seems it’s an Core issue. Even with a clean installation it appears. I’ll try again with the latest version of C5. Maybe this helps…
I have occasionally used an alias to get round issues with class mapping. Not that specific issue, so a bit of a shot in the dark.
eg:
use Namespace\To\Cassname as AliasedName;
@jero’s thoughts on sequence of package loading also rings a bell. Its something I have encountered where I have packages optionally extending their functionality using classes provided by other packages.