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

PHP Notices showing up when trying to build schema yaml from db #25

Open
codeguruvp opened this issue Feb 7, 2017 · 5 comments · May be fixed by #34
Open

PHP Notices showing up when trying to build schema yaml from db #25

codeguruvp opened this issue Feb 7, 2017 · 5 comments · May be fixed by #34

Comments

@codeguruvp
Copy link

codeguruvp commented Feb 7, 2017

Hi,

I am getting the following PHP Notice multiple times when trying to build schema from db

PHP Notice: Undefined index: type in /workspace/virtual_hosts/Daily/lib/vendor/lexpress/doctrine1/lib/Doctrine/Import/Builder.php on line 785

Here's symfony command I'm using:
./symfony doctrine:build-schema

I'm on PHP 7.1.1 running lexpress (Symfony 1.5.7 and Doctrine1-dev-master)

@j0k3r
Copy link

j0k3r commented Feb 7, 2017

Feel free to provide a PR to fix that notice.
We didn't test doctrine1 over PHP 7.1.1

@endelwar endelwar linked a pull request Sep 11, 2017 that will close this issue
@desyncr
Copy link

desyncr commented Dec 20, 2018

It seems it's related to #64

@alquerci
Copy link

Hello @codeguruvp

As the PR #64 is already in progress but it still miss a test case.

Feel free to help @desyncr to add a test case or at least to isolate the bug with the minimum of data fixtures.


We didn't test doctrine1 over PHP 7.1.1

@j0k3r I do not think so, as I ran tests with PHP 7.1 [ref]. Then is more about a missing test for this case.

@codeguruvp
Copy link
Author

codeguruvp commented Dec 21, 2018

Hi @alquerci
I am no longer involved in any active symfony 1.4 based projects any longer. So I do not have dev environment with that config that I can test right away. Therefore, unfortunately, I am not in a position to contribute right now. From what I remember, the issue was trivial as it was just a missing index warning that I was receiving while performing.

./symfony doctrine:build-schema

I was able to suppress it by simply checking whether the the variable was actually set and that basically worked for me for what I needed.

Changing (in lexpress/doctrine1/lib/Doctrine/Import/Builder.php )

 if ($relation["type"] == Doctrine_Relation::ONE) 

to

 if (isset($relation["type"]) && $relation["type"] == Doctrine_Relation::ONE) 

In terms of reproducing it, this can be done with a minimal set of data in the database and running the above command. All the command does is build/rebuild the schema for you. The warning should show during the execution.
Sorry if I am not of more help to you guys.
Thank you

@alquerci
Copy link

@codeguruvp you took time to write this issue, thank you. And the info that it can be reproduced with a minimal set of data in the database, it's already a good help.

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

Successfully merging a pull request may close this issue.

4 participants