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

Regression in Builder Breaks Generated Entities #1324

Closed
thomaskuehnel opened this issue Jan 3, 2017 · 6 comments
Closed

Regression in Builder Breaks Generated Entities #1324

thomaskuehnel opened this issue Jan 3, 2017 · 6 comments

Comments

@thomaskuehnel
Copy link

thomaskuehnel commented Jan 3, 2017

The alpha 6 release introduced a regression in the generation of entity files. It's very likely due to this change: #1090

We recently updated Propel to version alpha 6 at Spryker an are seeing issues with platforms supporting native id-method auto-increment (e.g. MySql).

It seems that the changes applied to DefaultPlatform::getIdentifierPhp() (https://github.com/propelorm/Propel2/blob/2.0.0-alpha6/src/Propel/Generator/Platform/DefaultPlatform.php#L1347) are not in sync with how this method gets called in ObjectBuilder::addDoInsertBodyRaw() (https://github.com/propelorm/Propel2/blob/2.0.0-alpha6/src/Propel/Generator/Builder/Om/ObjectBuilder.php#L5887).

The results in the generated entity files look something like this:
$pk = $con'foo-pk-seq'->lastInsertId();
which results in a critical parse error.

Thanks for looking into it.

@marcj
Copy link
Member

marcj commented Jan 3, 2017

I don't think #1090 is responsible for this. Can you give me your schema.xml that generates that wrong php code?

@thomaskuehnel
Copy link
Author

thomaskuehnel commented Jan 3, 2017

Thanks for the quick response.
It's not only one schema file that causes the issue, it's all that define id-method-parameter. Here's an example: https://github.com/spryker/Acl/blob/master/src/Spryker/Zed/Acl/Persistence/Propel/Schema/spy_acl.schema.xml#L17

The issue doesn't occur with Propel 2.0.0 alpha5 though

@marcj marcj closed this as completed in dc55788 Jan 3, 2017
@marcj
Copy link
Member

marcj commented Jan 3, 2017

You were right, #1090 was buggy. I fixed it in master.

@thomaskuehnel
Copy link
Author

thomaskuehnel commented Jan 3, 2017

Thanks a lot for taking care of it so quickly. Do you have an ETA on a new release that contains this fix?

@marcj
Copy link
Member

marcj commented Jan 3, 2017

@thomaskuehnel
Copy link
Author

Thanks for the awesome support! It is highly appreciated 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants