Search code examples
phpdrupal-7civicrm

CiviCRM class name error


I am currently learning how to use the CiviCRM Framework and in doing so I decided to make an extension for practice. The purpose of the extension is to record periods for memberships on their renewal or when they are created but when I try to create a new membership after activating the extension I get the error: Fatal error: Class name must be a valid object or a string in C:\xampp\htdocs\mydrupalsite\sites\all\modules\civicrm\Civi\API\SelectQuery.php on line 101
I also noticed that when I tried to renew a membership the page just kept on loading on and on and I had to close the page. I disabled my extension and tried it with another similar extension but I still got the same errors.
I am using version 4.7 of the CiviCRM Framework


Solution

  • I have just discovered that the reason for this was because I did not implement the hook hook_civicrm_entityTypes. I did so and now everything works fine.