Thanks a lot. What about users?
kklepper opened this issue · 13 comments
As far as I can see, there is no way to add users an no way to login as admin. Correct? Left as an exercise?
The AdminUserController allows you to manage users.
A default admin/admin user is provided in the db dump.
Ok, I try to learn. I saw admin in the dump, but what about the password?
Also "admin", like I said above.
Oh, sorry, didn't realize that. I made a mistake in my apache conf, set the web root wrong.
By the way, your work is beautiful, I'd really like to know.
Being admin, I tried to post a comment.
http://bolt.loc/artist/12#comment_form
Notice: Undefined variable: app in J:\www\musicbox\src\MusicBox\Controller\ArtistController.php on line 124
Whoops, looks like something went wrong.
1/1 Swift_RfcComplianceException: Address in mailbox given [] does not comply with RFC 2822, 3.6.2.
This looks fine to me:
$app['admin_email'] = 'noreply@musicbox.nothing';
$app['site_email'] = 'noreply@musicbox.nothing';
$app['swiftmailer.options'] = array(
'host' => 'host',
'port' => '25',
'username' => 'username',
'password' => 'password',
'encryption' => null,
'auth_mode' => null
);
added a user. saw success page, then I clicked on my profile.
http://bolt.loc/me
Whoops, looks like something went wrong.
1/1 Twig_Error_Runtime: Impossible to access an attribute ("id") on a boolean variable ("") in "profile.html.twig" at line 29
in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 369
at Twig_Template->getAttribute(false, 'id') in J:\www\musicbox\app\cache\twig\b6\3c\95de87d93cee7ac7c9ea1811b8c5.php line 92
at __TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5->block_content(array('user' => object(User), 'memberSince' => '24 days 17 hours 14 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application), 'active' => 'homepage'), array())
at call_user_func(array(object(__TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5), 'block_content'), array('user' => object(User), 'memberSince' => '24 days 17 hours 14 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*), array(*DEEP NESTED ARRAY*)), 'app' => object(Application), 'active' => 'homepage'), array()) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 133
at Twig_Template->displayBlock('content', array('user' => object(User), 'memberSince' => '24 days 17 hours 14 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application), 'active' => 'homepage'), array('content' => array(object(__TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5), 'block_content'))) in J:\www\musicbox\app\cache\twig\1f\ca\f47d4664da2231899d7160d39ef1.php line 130
at __TwigTemplate_1fcaf47d4664da2231899d7160d39ef1->doDisplay(array('user' => object(User), 'memberSince' => '24 days 17 hours 14 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application), 'active' => 'homepage'), array('content' => array(object(__TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5), 'block_content'))) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 264
at Twig_Template->displayWithErrorHandling(array('user' => object(User), 'memberSince' => '24 days 17 hours 14 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application), 'active' => 'homepage'), array('content' => array(object(__TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5), 'block_content'))) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 238
at Twig_Template->display(array('user' => object(User), 'memberSince' => '24 days 17 hours 14 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application), 'active' => 'homepage'), array('content' => array(object(__TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5), 'block_content'))) in J:\www\musicbox\app\cache\twig\b6\3c\95de87d93cee7ac7c9ea1811b8c5.php line 26
at __TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5->doDisplay(array('user' => object(User), 'memberSince' => '24 days 17 hours 14 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application)), array()) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 264
at Twig_Template->displayWithErrorHandling(array('user' => object(User), 'memberSince' => '24 days 17 hours 14 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application)), array()) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 238
at Twig_Template->display(array('user' => object(User), 'memberSince' => '24 days 17 hours 14 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)))) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 249
at Twig_Template->render(array('user' => object(User), 'memberSince' => '24 days 17 hours 14 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)))) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Environment.php line 288
at Twig_Environment->render('profile.html.twig', array('user' => object(User), 'memberSince' => '24 days 17 hours 14 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)))) in J:\www\musicbox\src\MusicBox\Controller\UserController.php line 35
at UserController->meAction(object(Request), object(Application))
at call_user_func_array(array(object(UserController), 'meAction'), array(object(Request), object(Application))) in J:\www\musicbox\vendor\symfony\http-kernel\Symfony\Component\HttpKernel\HttpKernel.php line 117
at HttpKernel->handleRaw(object(Request), '1') in J:\www\musicbox\vendor\symfony\http-kernel\Symfony\Component\HttpKernel\HttpKernel.php line 61
at HttpKernel->handle(object(Request), '1', true) in J:\www\musicbox\vendor\silex\silex\src\Silex\Application.php line 502
at Application->handle(object(Request)) in J:\www\musicbox\vendor\silex\silex\src\Silex\Application.php line 479
at Application->run() in J:\www\musicbox\web\index.php line 13
Pushed a fix for that.
logged in as user, http://bolt.loc/me worked fine
So users cannot add artists, only see their likes, right?
J:\www\musicbox>git pull https://github.com/bojanz/musicbox.git
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 10 (delta 2), reused 3 (delta 0)
Unpacking objects: 100% (10/10), done.
From https://github.com/bojanz/musicbox
- branch HEAD -> FETCH_HEAD
Updating b8e351c..a02a22a
Fast-forward
src/MusicBox/Controller/ArtistController.php | 4 ++--
src/routes.php | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
logged out as user, logged in as admin, http://bolt.loc/me same thing.
Whoops, looks like something went wrong.
1/1 Twig_Error_Runtime: Impossible to access an attribute ("id") on a boolean variable ("") in "profile.html.twig" at line 29
in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 369
at Twig_Template->getAttribute(false, 'id') in J:\www\musicbox\app\cache\twig\b6\3c\95de87d93cee7ac7c9ea1811b8c5.php line 92
at __TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5->block_content(array('user' => object(User), 'memberSince' => '24 days 17 hours 19 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application), 'active' => 'homepage'), array())
at call_user_func(array(object(__TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5), 'block_content'), array('user' => object(User), 'memberSince' => '24 days 17 hours 19 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*), array(*DEEP NESTED ARRAY*)), 'app' => object(Application), 'active' => 'homepage'), array()) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 133
at Twig_Template->displayBlock('content', array('user' => object(User), 'memberSince' => '24 days 17 hours 19 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application), 'active' => 'homepage'), array('content' => array(object(__TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5), 'block_content'))) in J:\www\musicbox\app\cache\twig\1f\ca\f47d4664da2231899d7160d39ef1.php line 130
at __TwigTemplate_1fcaf47d4664da2231899d7160d39ef1->doDisplay(array('user' => object(User), 'memberSince' => '24 days 17 hours 19 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application), 'active' => 'homepage'), array('content' => array(object(__TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5), 'block_content'))) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 264
at Twig_Template->displayWithErrorHandling(array('user' => object(User), 'memberSince' => '24 days 17 hours 19 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application), 'active' => 'homepage'), array('content' => array(object(__TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5), 'block_content'))) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 238
at Twig_Template->display(array('user' => object(User), 'memberSince' => '24 days 17 hours 19 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application), 'active' => 'homepage'), array('content' => array(object(__TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5), 'block_content'))) in J:\www\musicbox\app\cache\twig\b6\3c\95de87d93cee7ac7c9ea1811b8c5.php line 26
at __TwigTemplate_b63c95de87d93cee7ac7c9ea1811b8c5->doDisplay(array('user' => object(User), 'memberSince' => '24 days 17 hours 19 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application)), array()) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 264
at Twig_Template->displayWithErrorHandling(array('user' => object(User), 'memberSince' => '24 days 17 hours 19 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)), 'app' => object(Application)), array()) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 238
at Twig_Template->display(array('user' => object(User), 'memberSince' => '24 days 17 hours 19 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)))) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Template.php line 249
at Twig_Template->render(array('user' => object(User), 'memberSince' => '24 days 17 hours 19 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)))) in J:\www\musicbox\vendor\twig\twig\lib\Twig\Environment.php line 288
at Twig_Environment->render('profile.html.twig', array('user' => object(User), 'memberSince' => '24 days 17 hours 19 minutes ago', 'groupedLikes' => array(array(object(Like), object(Like), object(Like), object(Like), object(Like), object(Like)), array(object(Like)), array(), array(), array(), array(), array(), array(), array(), array(*DEEP NESTED ARRAY*)))) in J:\www\musicbox\src\MusicBox\Controller\UserController.php line 35
at UserController->meAction(object(Request), object(Application))
at call_user_func_array(array(object(UserController), 'meAction'), array(object(Request), object(Application))) in J:\www\musicbox\vendor\symfony\http-kernel\Symfony\Component\HttpKernel\HttpKernel.php line 117
at HttpKernel->handleRaw(object(Request), '1') in J:\www\musicbox\vendor\symfony\http-kernel\Symfony\Component\HttpKernel\HttpKernel.php line 61
at HttpKernel->handle(object(Request), '1', true) in J:\www\musicbox\vendor\silex\silex\src\Silex\Application.php line 502
at Application->handle(object(Request)) in J:\www\musicbox\vendor\silex\silex\src\Silex\Application.php line 479
at Application->run() in J:\www\musicbox\web\index.php line 13
http://bolt.loc/artist/13#comment_form as admin
Whoops, looks like something went wrong.
1/1 InvalidArgumentException: Identifier "mailer" is not defined.
in J:\www\musicbox\vendor\pimple\pimple\lib\Pimple.php line 78
at Pimple->offsetGet('mailer') in J:\www\musicbox\src\MusicBox\Controller\ArtistController.php line 127
at ArtistController->sendNotification(object(Comment), object(Application)) in J:\www\musicbox\src\MusicBox\Controller\ArtistController.php line 67
at ArtistController->viewAction(object(Request), object(Application))
at call_user_func_array(array(object(ArtistController), 'viewAction'), array(object(Request), object(Application))) in J:\www\musicbox\vendor\symfony\http-kernel\Symfony\Component\HttpKernel\HttpKernel.php line 117
at HttpKernel->handleRaw(object(Request), '1') in J:\www\musicbox\vendor\symfony\http-kernel\Symfony\Component\HttpKernel\HttpKernel.php line 61
at HttpKernel->handle(object(Request), '1', true) in J:\www\musicbox\vendor\silex\silex\src\Silex\Application.php line 502
at Application->handle(object(Request)) in J:\www\musicbox\vendor\silex\silex\src\Silex\Application.php line 479
at Application->run() in J:\www\musicbox\web\index.php line 13
If you open profile.html.twig you will see that line 29 tries to get "like.artist.id". Since it's complaining about artist being FALSE, that means there is a broken reference somewhere (in the database or the code). Find out where and why (this is a learning project so you have a great first exercise).
The second one is because $app['mailer'] is not registered anywhere, I committed a fix for that.
id 13 is ok:
My Master >select artist_id from artists;
+-----------+
| artist_id |
+-----------+
| 2 |
| 11 |
| 12 |
| 13 |
| 14 |
| 15 |
| 17 |
| 18 |
| 19 |
| 24 |
+-----------+
10 rows in set (0.00 sec)
My Master >select * from likes;
+---------+-----------+---------+------------+
| like_id | artist_id | user_id | created_at |
+---------+-----------+---------+------------+
| 1 | 11 | 1 | 1380060156 |
| 2 | 17 | 1 | 1380060156 |
| 3 | 13 | 1 | 1380060180 |
| 4 | 15 | 1 | 1380060180 |
| 5 | 24 | 1 | 1380063121 |
| 6 | 18 | 1 | 1380063163 |
| 7 | 16 | 1 | 1380131610 |
+---------+-----------+---------+------------+
7 rows in set (0.00 sec)
I see this route: artist_like
try http://bolt.loc/artist/13/like => empty screen
pulled the fix
http://bolt.loc/artist/2#comment_form
Catchable fatal error: Argument 1 passed to Swift_Mailer::send() must implement interface Swift_Mime_Message, string given, called in J:\www\musicbox\src\MusicBox\Controller\ArtistController.php on line 127 and defined in J:\www\musicbox\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Mailer.php on line 75
Pushed a fix for the last error.
Pull requests welcome for the rest. I don't have time for further fixes.