Closed ghost closed 7 years ago
I don't think old Propel is compatible with new Symfony 2.8.8.
Which version should I choose? I just did a composer require propel/propel-bundle. The Version was choosed automatically.
I switched back to PropelBundle 1.4.5. Error is gone now and profiler is working again. Anyway, I'll leave this open.
When possible upgrade to v2.
Unfortunately, not possible. :/ v2 is not compatible with FOSUserBundle.
PR #429 should fix this issue.
For a while, you should rename your foo
connection by default
.
propel:
dbal:
default_connection: default
connections:
default:
driver: mysql
user: %database_user%
password: %database_password%
dsn: mysql:host=%database_host%;dbname=%database_name%;charset=UTF8
options: {}
attributes: {}
@nibsirahsieu You are right. This fixes the bug. Anyway, I'll leave this open until #429 is merged.
@nibsirahsieu No, I'm wrong. This leads to an error:
Get a No connection information in your runtime configuration file for datasource [main]
everytime I request my database.
Do you know more about that?
From propel/propel1/runtime/lib/Propel.php
public static function getMasterConnection($name) // $name is 'main'
{
If I switch back to 'main', then things are fine, but the profiler is not working as expected.
Seems that they are relying on a datasources config param:
/**
* Returns the name of the default database.
*
* @return string Name of the default DB
*/
public static function getDefaultDB()
{
if (self::$defaultDBName === null) {
// Determine default database name.
self::$defaultDBName = isset(self::$configuration['datasources']['default']) && is_scalar(self::$configuration['datasources']['default']) ? self::$configuration['datasources']['default'] : self::DEFAULT_NAME;
}
return self::$defaultDBName;
}
How to configure this?
it seems you forgot to change the database name in your schema file
and don't forget to rebuild your models
Ahh, you are right. I did what you said and now it's working like a charm. Should I close this issue or wait until the PR is merged?
no, just leave it open.
Hey,
I've this in my config:
If I try to open the profiler, there is an error:
When I specify the adapter instead of the driver there is another error:
What could be the reason for this?
Can anyone help?
Best, Christian