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

Call to a member function getLanguage() on nul #4

Open
betterapp opened this issue Jan 13, 2022 · 6 comments
Open

Call to a member function getLanguage() on nul #4

betterapp opened this issue Jan 13, 2022 · 6 comments

Comments

@betterapp
Copy link

Hello

I try to setup pipe line import.
I set up everything like in Your video and when I try to run import I get error:

[2022-01-13 11:20:39] request.CRITICAL: Uncaught PHP Exception Error: "Call to a member function getLanguage() on null" at /.../www/vendor/blackbit/data-director/Controller/RestController.php line 363 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to a member function getLanguage() on null at /.../www/vendor/blackbit/data-director/Controller/RestController.php:363)"} []

I use: BDD 2.7.0

@BlackbitDevs
Copy link
Collaborator

I have just fixed it and released 2.7.8.
But are you sure that the firewall is into place? Because I wonder how you can access the REST API endpoint without a user. Please check your <Pimcore-Root>/config/packages/security.yaml for the point firewalls. It should look like this:

security:
    ...
    firewalls:
        data_director_webservice_short_urls: '%data_director.security.firewalls.webservice_short_urls%'
        data_director_webservice: '%data_director.security.firewalls.webservice%'
        data_director_webservice_documentation: '%data_director.security.firewalls.webservice_documentation%'
        ...

@betterapp
Copy link
Author

betterapp commented Jan 13, 2022

hmmm I do not have this file - why ? the location You wroted is for PIM >=10. We use 6.9

@betterapp
Copy link
Author

also when I click on (+) to install this bundle it show install was successful but the green install button stay. It should change to red (uninstall).
image

@BlackbitDevs
Copy link
Collaborator

BlackbitDevs commented Jan 13, 2022

Which Pimcore version are you using? In Pimcore 10 <Pimcore-Root>/config/packages/security.yaml should exist, see https://github.com/pimcore/skeleton/blob/10.x/config/packages/security.yaml. In Pimcore <= 6 it should be app/config/security.yml.

It is normal that the install button stays green. The reason is that in Pimcore 10 there is no plugin update anymore. Executing plugin migrations is only possible by executing bin/console doctrine:migrations:migrate --prefix Blackbit\\DataDirectorBundle - this is on the one hand completely ugly and prone to spelling errors, so I did not want users having to remember this (but of course it still is possible to use this).
Moreover above command throws an error if there are no migrations to be executed. This makes automatic deployment complicated. For this reason I decided to extend the pimcore:bundle:install command that it can be used also for updates.
For the data director the pimcore:bundle:install command:

  • executes migrations
  • does not fail if there are no migrations to be executed -> makes automatic deployments easy
  • is available also in Pimcore <= 6

@betterapp
Copy link
Author

betterapp commented Feb 14, 2024

There is no information in documentation about this:
Why ?

security:
    firewalls:
        data_director_webservice_short_urls: '%data_director.security.firewalls.webservice_short_urls%'
        data_director_webservice: '%data_director.security.firewalls.webservice%'
        data_director_webservice_documentation: '%data_director.security.firewalls.webservice_documentation%'

@betterapp betterapp reopened this Feb 14, 2024
@betterapp
Copy link
Author

When I try to add it in Pimcore 11 I get error:

Unrecognized option "guard" under "security.firewalls.data_director_webservice_short_urls". Available options are "access_denied_handler", "access_denied_url", "access_token", "context", "custom_authenticators", "entry_point", "form_login", "form_login_ldap", "host", "http_basic", "http_basic_ldap", "json_login", "json_login_ldap", "lazy", "login_link", "login_throttling", "logout", "methods", "pattern", "provider", "remember_me", "remote_user", "request_matcher", "required_badges", "security", "stateless", "switch_user", "two_factor", "user_checker", "x509".

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

No branches or pull requests

2 participants