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

Method Vsch\TranslationManager\Controller::postFind does not exist. #118

Open
dx01x opened this issue May 7, 2018 · 0 comments
Open

Method Vsch\TranslationManager\Controller::postFind does not exist. #118

dx01x opened this issue May 7, 2018 · 0 comments

Comments

@dx01x
Copy link

dx01x commented May 7, 2018

"laravel/framework": "5.6.*",
"vsch/laravel-translation-manager": "~2.1"

When accessing the web interface, and clicking on "Add references" button, it triggers "500 (Internal Server Error)".

In debugger,

BadMethodCallException Method Vsch\TranslationManager\Controller::postFind does not exist.

There is an apiFindReferences function in controller,

public function apiFindReferences()
    {
        if (Gate::allows(Manager::ABILITY_ADMIN_TRANSLATIONS)) {
            $connection = Request::get('connectionName');
            $this->useConnection($connection);

            $numFound = $this->manager->findTranslations();

            return Response::json(array('status' => 'ok', 'counter' => (int)$numFound));
        }
        return $this->respondNotAdmin(false);
    }

Duplicated the code block to create method "postFind", and it does work now.

public function postFind()
    {
        if (Gate::allows(Manager::ABILITY_ADMIN_TRANSLATIONS)) {
            $connection = Request::get('connectionName');
            $this->useConnection($connection);

            $numFound = $this->manager->findTranslations();

            return Response::json(array('status' => 'ok', 'counter' => (int)$numFound));
        }
        return $this->respondNotAdmin(false);
    }

Thanks 👍

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

1 participant