concrete5 5.7: Add-On Development. "An unexpected error occurred."
Permalink 1 user found helpfulI have followed this tutorial:
concrete5 5.7: Add-On Development, Part 1
http://www.concrete5.org/documentation/how-tos/developers/concrete5...
I edited the code following the tutorial, and it matches the code found in "Part 2" at the following link...
http://andrewembler.com/application/files/8914/3578/2310/email_list...
After adding the Email List Signup addon, when I click on "Join our mailing list...Enter your email address" and enter a valid email address, after clicking the "Sign up" button I receive the following error:
An unexpected error occurred.
Class 'Concrete\Package\EmailListSignup\Models\EmailListSignup' not found
I also downloaded the code referenced here:
http://andrewembler.com/application/files/8914/3578/2310/email_list...
After installing the add-on again, I continue to receive the same error message:
An unexpected error occurred.
Class 'Concrete\Package\EmailListSignup\Models\EmailListSignup' not found
I cannot figure out what is causing this error.
In addition, I am having no success searching for other Add-On tutorials for 5.7. I can't seem to find any relevant information in the Docs.
Any suggestions on why I get the error listed above, or where I can find more Add-On tutorials? Thanks!
Here is my Environment Information:
# concrete5 Version
Core Version - 5.7.5.6
Version Installed - 5.7.5.6
Database Version - 20151221000000
# concrete5 Packages
Customize Editing Interface (0.9.1), Email List Signup (1.5.5), Login/Logout Link (1.0).
...
Thanks!
I watched you video which was a great help in understanding the concrete5 namespacing and file structure, Thanks very much for that.
I'm still getting an Class 'Concrete\Package\EmailListSignup\Src\EmailListSignup' not found error though, and have checked each reference over and over.
My email-list.signup php file is in an src folder and the document head is as follows:
namespace Concrete\Package\EmailListSignup\Src;
use Concrete\Core\Legacy\Model;
use Loader;
class EmailListSignup extends Model {
I'd really appreciate a hint,
Thanks,
Una
In your package, the src folder should be lowercase, but then the classes inside should be CamelCase.
So src/EmailListSignup.php
I think the rest of the tutorial should be fine, it's just a case of moving your models into the right directory and adjusting the namespaces.
I did a video a while back to try and explain namespacing (and to help me understand it myself). See this point of the video where I cover the src directory:
https://youtu.be/FjJJUrggPM0?t=700...