-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
returning null from repo on fixtures, but method works on controller #294
Comments
Could you please put the fixture class in here where null happens? Also please check if there is something in your configuration that might inject a different |
Thanks but not sure I understand your comment. What do you mean by Also note that in the section below from App\Fixtures, if I comment out
The issue remains why can't I fetch the random To be clear, the Category table is pre populated in the database. |
As I said above, the table Category was pre populated in the db. And as you know Fixtures is supposed to purge the db before generating new data. I had previously thought that that was causing the error, as the table Category was also purged and when But I checked on PhpMyAdmin and the table was still there after running fixtures and DefaultController portion was working even after clearing the cache. Also, another table As it happens, when I came back to this today, I found that DefaultController was throwing the same error as Fixtures, ie, So, there seems to be a discrepancy in-between what I was seeing on PhpMyAdmin and what Fixtures was getting. Bottom line is that the error is due to the fact that, for Fixtures, the Category table was empty, while, for some reason, DefaultController and PhpMyAdmin were still finding data there. But the data was eventually purged from Category. The issue will become how to exclude Category table from purge. And I know you have this PR in process. Otherwise I will need to see how to have Fixtures also populate Category table, which does not look trivial given the specific methodology of |
I was asking about the full fixture without any cut code. Or maybe a smaller example were return |
Thanks. I do believe the issue is with the purge, so no reason to pursue this here. |
Not sure if I am going about this the proper way but, in any case, something seems to be amiss.
On fixtures I am attempting to access a random category entity to add to an Ad entity. First I attempted to do that directly on fixtures, but as it did not work I put the method on a regular controller and injected the controller as service on fixtures just to check it.
While the method works as expected on the controller, it returns NULL on fixtures.
The Category entity is a GEDMO tree.
This is what I believe to be the relevant portions of:
AppFixtures
On App\DefaultController things works as expected an it outputs the JSON with the
correct info.
The text was updated successfully, but these errors were encountered: