Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
$DatabaseColumns mapping problem
Hey all,
I recently followed the wordpress integration tutorial and setup a forum/blog hybrid. A bit more tinkering with the login/session stuff has made this quite seamless now.
The problem im having is accessing Wordpress information from within Vanilla. It was my understanding (from the article) that I could map different DB columns into my User object like this, in conf/database.php:
However when I test in the forum the $this->Context->Session->User object doesnt have this field.
Similarly, I tried to map a new $Definition in conf/language.php like so:
And this doesnt display in Vanilla.
Can someone give me a pointer here? Until I work out what's going on with the architecture of Vanilla, it's really difficult to debug.
Thanks all!
mafro
I recently followed the wordpress integration tutorial and setup a forum/blog hybrid. A bit more tinkering with the login/session stuff has made this quite seamless now.
The problem im having is accessing Wordpress information from within Vanilla. It was my understanding (from the article) that I could map different DB columns into my User object like this, in conf/database.php:
// Also map the Wordpress columns into Vanilla
$DatabaseColumns['User']['display_name'] = 'display_name';
However when I test in the forum the $this->Context->Session->User object doesnt have this field.
Similarly, I tried to map a new $Definition in conf/language.php like so:
$Definition['SignOut'] = 'Logout';
And this doesnt display in Vanilla.
Can someone give me a pointer here? Until I work out what's going on with the architecture of Vanilla, it's really difficult to debug.
Thanks all!
mafro
0
This discussion has been closed.
Comments
$DatabaseColumns['User']['Name'] = 'display_name';
You're basically telling Vanilla to look for a column in the database called 'display_name' instead of Vanilla's default of 'Name'.
Dictionary definitions should also be written in Vanilla's conventions like they are in language/English/definitions.php:
$Context->Dictionary['SignOut'] = 'Logout';
You only need to copy & paste the definitions you want to change to conf/language.php
I had clearly just got the Dictionary bit wrong - but I had assumed with the Database mapping columns stuff that the SQL was built dynamically from the column mappings you create in the configuration.. And wouldn't that make more sense?
Anyways.. I got it working using your example above of mapping into 'Name'. It would be more useful for me if I could not overwrite the login name, and say for example map onto a different Vanilla column:
$DatabaseColumns['User']['FirstName'] = 'display_name';
However this doesn't work..
Any input appreciated.
mafro