Hi,
I'm using elgg 1.8.6 and I have a problem with my Entities.
I add the following code into the init function of my plugin:
elgg_register_entity_type('user', 'myuser');
add_subtype('user', 'myuser', 'MyUser');
The class MyUser is defined into the class folder of my plugin
The system seem to work fine, but I had 2 problems:
1) Into the log file I see a lot of Class 'MyUser' was not found, missing plugin?
2) when I call the get_entity method, it returns to me an ElggUser entity, not a MyUser one.
Is this a coding error or a new bug?
Thanks in advance.
M.T.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Cash@costelloc
Cash - 0 likes
- Michelantonio Trizio@mik3lantoni0
Michelantonio Trizio - 0 likes
- Brett@brett.profitt
Brett - 0 likes
- The MyUser class is the only class defined in mod/your_plugin/classes/MyUser.php
- You have created users and set their subtype to myuser.
- Dan Dutrow@dutrow
Dan Dutrow - 0 likes
You must log in to post replies.The folder is "classes", not "class".
Yes, of course, the class folder named "classes".
This is not the problem. Thank you anyway!
Can you show your full code, preferably as a gist?
Some things to check:
I was having a similar problem, and found a solution that might work for you too.
When I was specifying a new class, I originally chose a different name, and then modified it later. However, when the type was registered in the elgg_entity_subtype table, it assigned it the original name.
You might be able to go into your phpmyadmin and edit the cell assigned with your myuser object to use the MyUser class.