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

Cannot expand relation #237

Open
CyberiaResurrection opened this issue Mar 14, 2020 · 8 comments
Open

Cannot expand relation #237

CyberiaResurrection opened this issue Mar 14, 2020 · 8 comments

Comments

@CyberiaResurrection
Copy link
Contributor

@CyberiaResurrection, i try on a new clean instance of laravel and now it has passed this issue, but i have another 2 new issues.

  1. Route login not found. I have in .env APP_DISABLE_AUTH=true and i run artisan config:clear and artisan config:cache and the problem still persist. As a temporary solution, we defined the following 3 routes :

$controllerMethod = '\AlgoWeb\PODataLaravel\Controllers\ODataController@index';
Route::get('odata2.svc/$metadata', ['uses' => $controllerMethod]);
Route::any('odata2.svc/{section}', ['uses' => $controllerMethod])->where(['section' => '.*']);
Route::any('odata2.svc', ['uses' => $controllerMethod]);
Now it's working

  1. When I try to use the $expand parameter based on a relationship defined in the model, I receive the following error:

Symfony\Component\Debug\Exception\FatalThrowableError
Argument 2 passed to POData\Providers\Metadata\ResourceAssociationSet::keyNameFromTypeAndProperty() must be an instance of POData\Providers\Metadata\ResourceProperty, null given, called in /var/www/testing/vendor/algo-web/podata/src/POData/UriProcessor/QueryProcessor/ExpandProjectionParser/ExpandProjectionParser.php on line 193

Thank you very much and I really appreciate the effort.

Originally posted by @CalamarMihai in #236 (comment)

@CyberiaResurrection CyberiaResurrection changed the title CyberiaResurrection, I have another 2 new issues. I have another 2 new issues - login not found, cannot expand relation Mar 14, 2020
@CyberiaResurrection
Copy link
Contributor Author

CyberiaResurrection commented Mar 14, 2020

Since I cut a release overnight, and that seems to be a POData issue,@CalamarMihai, can you try setting your POData dependency to 0.3.7 on your testbed to see if that solves your second issue?

@c-harris
Copy link
Member

c-harris commented Mar 14, 2020

@CyberiaResurrection Can I propose an audit and we suspend anything AUTH related because a number of people have issues with it and the flag does not appear to work properly.

@CyberiaResurrection
Copy link
Contributor Author

@CalamarMihai, after seeing if explicitly including POData 0.3.7 on your testbed solves your issue or not (since I expect you're using dev-master on POData indirectly), you'll need to give me more information so I can reproduce your second issue, solve it (and, ultimately, add it as a regression test).

@CyberiaResurrection
Copy link
Contributor Author

@CalamarMihai, all packaged tests are currently passing on a clean install of POData-Laravel itself as at current master HEAD ( 7727b6e ). This is just trying to constrain where the problem lurks.

@c-harris , given the timing of the report, it looks like something fired up the hyperdrive and departed to east hyperspace among PRs 226 and/or 229 on POData. Given how big and gnarly 229 ended up, I'm suspecting that in lieu of further feedback.

In light of that, what do you propose to audit and what do you propose to look for?

@CalamarMihai
Copy link

First, I apologize for the delay.
Right now I have done a new test using the versions:

  • algo-web/podata 0.3.7
  • algo-web/podata-laravel dev-master 7727b6e
  • algo-web/o-data-metadata dev-master 4a7e2ef
  • Laravel Framework 6.18.3

The first issue is ok now, after reinstall, i had no issue with the authentication error.

I tried the common types of relationships supported by Eloquent (belongsTo, hasOne, hasMany, etc..)

Regardless of the value of parameter $expand, even if the relationship exists or not, I receive the same error. If you think it helps, I can make a copy of the project and database and put it on file sharing.

Sorry for my bad english and thanks for your help.

Models.zip

@CyberiaResurrection CyberiaResurrection changed the title I have another 2 new issues - login not found, cannot expand relation Cannot expand relation Mar 25, 2020
@CyberiaResurrection
Copy link
Contributor Author

Thanks for your patience, your help and the extra information, @CalamarMihai . I've updated the issue title and will try to investigate in the next few days, as I'm a little busy at the moment (unless @c-harris wants to take a swing).

@c-harris
Copy link
Member

I'll take a look shortly and see if we can spin up a regression test for this specific case.

@CalamarMihai
Copy link

Any news about this issue?

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

3 participants