Git Product home page Git Product logo

Comments (12)

SahAssar avatar SahAssar commented on August 23, 2024 1

@evertalbers Yep, this will get fixed in the next update... I'll just have to test that fix a bit to make sure it doesn't break taxonomy routes.

from translate.

SahAssar avatar SahAssar commented on August 23, 2024

Do you still have a contenttype called pages (not that it's required, just to help find the issue)? Cause the issue seems to be that it tries to find a repository called pages but can't find one...

from translate.

evertalbers avatar evertalbers commented on August 23, 2024

No, I don't have a 'pages' contenttype in my contenttypes.yml

I have had "pages" just after the install before importing my own contenttypes.yml, and there was still an empty 'pages' table in the MySQL table somewhere, I renamed it to see if that made any difference, but that did not help I think.

But there's probably still "page/pages" references in other locations that I'm not aware of. The error does not mention 'pages' out of te blue.

(FYI currently I do have the Dutch equivalent "paginas" but I'm not using the word "pages" here

paginas:
    name: Paginas
    singular_name: Pagina

)

Anywhere else that I should look?

from translate.

SahAssar avatar SahAssar commented on August 23, 2024

Seems like the error came to in #38 which introduced a hardcoded reference to the pages contenttype.
This line: https://github.com/AnimalDesign/bolt-translate/blob/master/src/TranslateExtension.php#L246 needs to be changed to something like $repo = $app['storage']->getRepository($content->contenttype['slug']);

from translate.

evertalbers avatar evertalbers commented on August 23, 2024

Copy-pasted your code, still an error but a different one:
Bolt \ Exception \ InvalidRepositoryException
Attempted to load repository for invalid class or alias: . Check that the class, alias or contenttype definition is correct.

You said "to be changed to something like..." but I'm afraid that I don't have the php skills to come up with other options for that line :-(

from translate.

SahAssar avatar SahAssar commented on August 23, 2024

Right, we need to actual content record first to do that... I'm not really at a computer where I can test/fix it right now, but you want to try $repo = $app['storage']->getRepository($request->get('contenttypeslug')); that might work. Otherwise I'll take a look at it in the coming days.

from translate.

evertalbers avatar evertalbers commented on August 23, 2024

Brilliant, that last one worked. Looks like I can go ahead now, until I meet the next hurdle.

Thanks so far!
I assume the above change will be in the next Bolt-Translate update?

from translate.

madc avatar madc commented on August 23, 2024

I think, this solution will fail on single pages, because then $request->get('contenttypeslug') in your example would hold Pagina.

from translate.

SahAssar avatar SahAssar commented on August 23, 2024

@madc I think bolt aliases the slug and the singular_slug to point to the same repository, but I'll have to test before I can say for sure.

from translate.

madc avatar madc commented on August 23, 2024

I did a quick test on the 3.0.12 release with pages/page and it gave me some error indicating that page is no valid contenttype..

from translate.

evertalbers avatar evertalbers commented on August 23, 2024

I'm not sure if it's the answer to your slug question above, but in my "project" contenttype, multilinguality seems to work fine so far: slug, {{ project.link }}, routing all work well.

from translate.

frozenshadow avatar frozenshadow commented on August 23, 2024

Same problem here. Did multiple clean installs (Bolt 3.0.12), all single page views got 404 errors after installing translate. Also upgraded one install from 2.2.23 to 3.0.12 and got an fatal error (because there wasn't a 404 page in the theme):

Request URL: bolt.prod/nl/page/over-ons
Symfony\Component\HttpKernel\Exception\HttpException thrown with message "Page page/ not found."

Stacktrace:
#9 Symfony\Component\HttpKernel\Exception\HttpException in /home/vagrant/projects/bolt-prod/vendor/silex/silex/src/Silex/Application.php:400
#8 Silex\Application:abort in /home/vagrant/projects/bolt-prod/vendor/bolt/bolt/src/Controller/Base.php:62
#7 Bolt\Controller\Base:abort in /home/vagrant/projects/bolt-prod/vendor/bolt/bolt/src/Controller/Frontend.php:155
#6 Bolt\Controller\Frontend:record in /home/vagrant/projects/bolt-prod/extensions/vendor/animal/translate/src/Frontend/LocalizedFrontend.php:78
#5 Bolt\Extension\Animal\Translate\Frontend\LocalizedFrontend:record in /home/vagrant/projects/bolt-prod/vendor/symfony/http-kernel/HttpKernel.php:144
#4 call_user_func_array in /home/vagrant/projects/bolt-prod/vendor/symfony/http-kernel/HttpKernel.php:144
#3 Symfony\Component\HttpKernel\HttpKernel:handleRaw in /home/vagrant/projects/bolt-prod/vendor/symfony/http-kernel/HttpKernel.php:64
#2 Symfony\Component\HttpKernel\HttpKernel:handle in /home/vagrant/projects/bolt-prod/vendor/silex/silex/src/Silex/Application.php:586
#1 Silex\Application:handle in /home/vagrant/projects/bolt-prod/vendor/silex/silex/src/Silex/Application.php:563
#0 Silex\Application:run in /home/vagrant/projects/bolt-prod/public/index.php:14

Let me know if you need more info.

from translate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.