Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate entity from webtools does not work #1415

Closed
zak-wojtek77 opened this issue Jan 6, 2020 · 10 comments
Closed

generate entity from webtools does not work #1415

zak-wojtek77 opened this issue Jan 6, 2020 · 10 comments
Assignees
Milestone

Comments

@zak-wojtek77
Copy link

zak-wojtek77 commented Jan 6, 2020

Expected and Actual Behavior

Generate entity from webtools does not work. After click button "Generate" nothing do. Also I don't see any errors on screen.

Phalcon WebTools

  • System info and versions (if possible): 4.0.x-dev
  • Phalcon Framework version: 4.0.0
  • PHP Version: 7.4
  • Operating System: Debian
  • Server: Nginx
@ruudboon ruudboon added this to Backlog in Phalcon Roadmap Jan 6, 2020
@Jeckerson Jeckerson self-assigned this Jan 6, 2020
@Jeckerson Jeckerson added this to the 4.0.x milestone Jan 6, 2020
@Jeckerson
Copy link
Member

Can you specify what exactly entities or which part of WebTools?

@zak-wojtek77
Copy link
Author

For every entity does not work.

@Jeckerson
Copy link
Member

image

Do you have SQL error message?

@zak-wojtek77
Copy link
Author

I have not any SQL error. I have upgrade devtools to v4.0.1 but still the same problem.

I click: Models -> Generate and next click button "Generate":
Przechwycenie obrazu ekranu_2020-01-21_09-07-18
Przechwycenie obrazu ekranu_2020-01-21_09-07-30

@Jeckerson
Copy link
Member

What fields and checkboxes do you select?

@zak-wojtek77
Copy link
Author

Exactly how is on the screen.

@Jeckerson Jeckerson moved this from Backlog to Current Sprint (Ends February 7th) in Phalcon Roadmap Jan 31, 2020
@tallande
Copy link

tallande commented Mar 12, 2020

Exactly de same trouble, with:

  • System info and versions (if possible): 4.0.x-dev
  • Phalcon Framework version: 4.0.0
  • PHP Version: 7.4
  • Operating System: CentOS 7
  • Server: Apache & Nginx

@mocallu
Copy link

mocallu commented May 23, 2020

I had the same problem. I solved removing the options from config's database array.

return new Config([
    'database' => [
        'adapter'    => 'Mysql',
        'host'       => getenv('MYSQL_HOST') ?: '',
        'username'   => getenv('MYSQL_USER') ?: '',
        'password'   => getenv('MYSQL_PASSWORD') ?: '',
        'dbname'     => getenv('MYSQL_DATABASE') ?: '',
        'charset'    => 'utf8',
        // 'options' => [
        //     PDO::ATTR_EMULATE_PREPARES => false,
        //     PDO::ATTR_STRINGIFY_FETCHES => false,
        // ]
    ],
    'application' => [
        'modelsDir'      => '/models/',
        'controllersDir' => '/controllers/',
        'migrationsDir'  => '/migrations/',
        'baseUri'        => '/',
    ]
]);

After create the models, return with the options.

It's happening because before adapter instance, there are some lines creating a condition that removes all database config in $configArray overriding just with options.

if (isset($configArray['options'])) {
	$configArray = $configArray['options'];
}
/** @var AbstractPdo $db */
$db = new $adapterName($configArray);

It's a little weird, I tried to understand why, but I can't.

That's the file and line:

if (isset($configArray['options'])) {

@BeMySlaveDarlin
Copy link
Contributor

BeMySlaveDarlin commented Mar 14, 2021

if (isset($configArray['options'])) {
	$configArray = $configArray['options'];
}

It was added in #1432 due to 'fix' PdoFactory behavior. Unnecessary and breaking addition.
Fixed in #1486

@Jeckerson
Copy link
Member

Will be released in next version.

Phalcon Roadmap automation moved this from Active Sprint Tasks to Implemented Mar 14, 2021
@niden niden moved this from Implemented to Released in Phalcon Roadmap Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Phalcon Roadmap
  
Released
Development

No branches or pull requests

5 participants