Comments (12)
@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.
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.
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.
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.
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.
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.
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.
I think, this solution will fail on single pages, because then $request->get('contenttypeslug')
in your example would hold Pagina
.
from translate.
@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.
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.
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.
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)
- Provide a short documentation about "how it works" HOT 1
- [BUG] Changelog is impossible to follow HOT 4
- Change the DB structure - use a table for translation HOT 2
- Arbitrary localized columns for searching
- translatable: true works but translatable: 1 not
- Redirecting homepage to subdomain HOT 1
- [BUG] No language switcher in contenttype when no tabs are present
- [RFC] Make language switcher on contenttype new pages configurable
- [RFC] Twig_Error_Runtime after updating to Translate 4.1.5 HOT 1
- Any page not preceded by '/contenttype' will switch website to default language HOT 1
- [RFC] Translate taxonomies HOT 2
- [BUG] saving with templatefields throws: Warning: Invalid argument supplied for foreach() HOT 1
- [BUG] status update deletes localized contents HOT 1
- Translations are not saved ? Missed a configuration ? HOT 9
- [RFC] Implementing a routing override blacklist
- Redirect ALL urls to default locale HOT 1
- [RFC] Remove /en slug from URL if default language is en_GB
- [BUG] Error when updating php7.2 -> php7.4 (but I found a trick) HOT 1
- [BUG] Composer error
- [BUG] repeater field is set to a row prior when there's no translation being set on the current row
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from translate.