Closed (fixed)
Project:
Coffee
Version:
8.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Apr 2020 at 12:20 UTC
Updated:
19 Apr 2021 at 13:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
michaelmol commentedWhat is the result of
admin/coffee/get-dataComment #3
andrimont commentedI get a long liste of values :
Comment #4
mr.baileysThis might be a duplicate of #3128587: coffee broken for multilingual sites/ sites in a subfolder
Comment #5
aporieIt's a duplicate from the other issue, problem is maintainer just released a stable version which has a completely different js.
Quick patch, need to be tested.
[EDIT] It seems it's already in dev actually.
Comment #6
aiphessame issue as mine: https://www.drupal.org/project/coffee/issues/3069537
dev and stable versions don't fix this and are unusable.
Comment #7
andrimont commentedBonjour @aiphes,
This seems to be ok now with Drupal 8.8.5 and the lates dev version. SOLVED for me.
Comment #8
aiphes@andrimont, ok I'll do an update because actually website is on D884
Comment #9
aiphesHi, after upgrade to D885 I get the same message and in watchdog it seem the path is wrong:
/fr/fr/admin/coffee/get-datainstead of/fr/admin/coffee/get-datawith Coffee 8.1.
probably more a Drupal missetting ? but which one ? or coffee dev version would be better ?
Comment #10
andrimont commented@aiphes I would get the coffee dev version. In my setting the path /fr/… or /en/… are fine.
Would the trouble be in the URL language detection configuration ?
Home Administration Configuration Regional and language Languages Detection and selectionIs the
ENGLISH (EN) PATH PREFIX (DEFAULT LANGUAGE)set to en (not blank) ?Comment #11
aipheshi
after visiting
/admin/config/regional/language/detectionI get for selected language:default language French (selected), other choice are English or French
Change to French only (not default one) >> no change
On
admin/config/regional/language/detection/url, prefix are good.This is on a dev website, on the production one, beta2 work (higlight, not ctrl + click).Weird thing.
Comment #12
andrimont commentedIt might no be related to Coffee, but check that English prefix is set to
en. By default it is blank (not for the other like French the prefix isfr) and gives issues.Otherwise the Coffee issue disappeared. I thought that it was the dev version.
Have you a strong cache clear with Devel ?
Comment #13
aiphesI just dump a copy of the Prod DB onto Dev, and I get the same error.
Here the difference is between coffee version only and D884 vs D885, but I can't force to use beta2 like on prod.
composer require 'drupal/coffee:^1.0-beta2'say nothing to install.Comment #14
rajab natshahComment #15
rajab natshahUpdate the patch for the 8.x-1.x-dev
Comment #16
rajab natshahUpdate the patch for the 8.x-1.0 release
Comment #17
rajab natshahNot sure why the patch is not applying!!!
It is one line after the fix. in the release and the dev
3128583-15.patch for latest DEV
3128583-16.patch for latest release 8.x-1.0
Comment #18
kbeck303 commentedThe patch in comment #16 is working for me with Drupal Core 8.8.8 and Coffee 8.x-1.0
Comment #19
a.milkovskyI have a multilingual setup with a different domain per language. The URLs are always absolute in this case.
The patch #7 fixes the issue for me as well.
Comment #20
rar9 commentedUsing official version with path does not fix the issue.
Could be related to coffee if coffee extra is also used
Comment #21
ebremner commentedWe have multisite with subdomains and none of the patches worked in our case.
Comment #22
rajab natshahComment #23
Ralf Eisler commentedPatch #16 works here on for the Administration menu but not for the Main navigation or a Custom navigation.
Coffee 8.x-1.0, PHP is 7.4.10, Core 8.9.6
Comment #24
aiphesPatch #16 work for me on D897 + PHP 7.3, migrated website from D6.
Comment #26
michaelmol commentedThanks all for resolving this issue!
Comment #27
steveoriolHello, by update the drupal/coffee (1.0.0 => 1.1.0) I get les message "
Could not load data, please refresh the page"all caches cleaned
and if I downgrade to 1.0.0, It is works back again...
My config: D9.1.5 php7.4
Comment #28
laborouge commentedSame for me for Cofee 8.x-1.1
My config: D9.1.5 php7.3.15
Comment #29
alison(probably not "needs review" right now -- they might ask us to create a new issue, but if we keep this thread, it'll be needs work, I think?)
I have the same issue as the last couple commenters -- updating from 1.0 to 1.1 has resulted in the "could not load data" message, plus a "page not found" on every admin page load (doesn't seem to happen when I'm on the site itself, while logged-in as an administrator):
Drupal 8.9.13, PHP 7.3
Comment #30
paperscenery commentedSame as previous commenters. D8.9.13 / php7.3.27 / Coffee 8.x-1.1
-Works as expected on frontend of site
-On admin pages I get "Could not load data, please refresh the page"
Error logged on every page load:
Type php
Date Monday, March 22, 9:30 am
User [adminuser]
Location https://[site.domain]/admin/coffee/get-data
Referrer https://[site.domain]/
Message Warning: array_flip(): Can only flip STRING and INTEGER values! in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 266 of /mnt/www/html/sitename/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php)
#0 /mnt/www/html/sitename/docroot/core/includes/bootstrap.inc(600): _drupal_error_handler_real(2, 'array_flip(): C...', '/mnt/www/html/e...', 266, Array)
#1 [internal function]: _drupal_error_handler(2, 'array_flip(): C...', '/mnt/www/html/e...', 266, Array)
#2 /mnt/www/html/sitename/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(266): array_flip(Array)
#3 /mnt/www/html/sitename/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(250): Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array)
#4 /mnt/www/html/sitename/docroot/core/lib/Drupal/Core/Entity/EntityBase.php(544): Drupal\Core\Entity\EntityStorageBase->load(NULL)
#5 /mnt/www/html/sitename/docroot/modules/contrib/publishcontent/src/Plugin/Menu/LocalTask/PublishContentLocalTask.php(28): Drupal\Core\Entity\EntityBase::load(NULL)
#6 /mnt/www/html/sitename/docroot/modules/contrib/coffee/src/Controller/CoffeeController.php(195): Drupal\publishcontent\Plugin\Menu\LocalTask\PublishContentLocalTask->getRouteParameters(Object(Drupal\Core\Routing\CurrentRouteMatch))
#7 /mnt/www/html/sitename/docroot/modules/contrib/coffee/src/Controller/CoffeeController.php(104): Drupal\coffee\Controller\CoffeeController->getLocalTasksForRoute('entity.node.can...', Array)
#8 [internal function]: Drupal\coffee\Controller\CoffeeController->coffeeData()
#9 /mnt/www/html/sitename/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#10 /mnt/www/html/sitename/docroot/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 /mnt/www/html/sitename/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#12 /mnt/www/html/sitename/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#13 /mnt/www/html/sitename/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 /mnt/www/html/sitename/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#15 /mnt/www/html/sitename/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /mnt/www/html/sitename/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /mnt/www/html/sitename/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /mnt/www/html/sitename/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /mnt/www/html/sitename/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /mnt/www/html/sitename/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /mnt/www/html/sitename/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /mnt/www/html/sitename/docroot/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /mnt/www/html/sitename/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#24 {main}
.
Severity Warning
Hostname [IP address]
Operations
Comment #31
paperscenery commentedFurther testing shows that it's not strictly divided between frontend and backend or one them vs. another. MOST (but not all) frontend pages work / NO backend pages work.
No difference when testing with php7.4 vs php 7.3
Comment #32
rar9 commented+1 front-page works
/admin pages doesn't D9.15 php 7.4.16
Comment #34
paperscenery commented@michaelmol
Tested with the new commit on the dev branch, but still no luck. Error logs suggest admin/coffee/get-data is being appended to the end of the current url rather than to the root URL of the site, thereby causing a Page Not Found. This might explain why it work fine from the front page.
I should also mention that reverting to Coffee 8.x-1.0 did not resolve the issue, so this may be a bug in Core. Again, testing on D8.9.13.
Comment #35
aporieSomehow url passed to ajax got relative.
Fix attached
Comment #37
michaelmol commentedComment #38
wturrell commentedJust to say the dev branch (with patch 35) working well on with D8.9.13 :)
Comment #39
paperscenery commentedConfirming dev branch release in #36 corrects the errors. No need to patch separately for me.
Drupal 8.9.13 / 7.3.27 / coffee 8.x-1.x-dev
@Aporie @michaelmol — thank you.
Comment #40
saschaeggiWould be cool if we can get a new release with this fix soon
Cheers
Comment #41
solideogloria commentedUm, can someone verify this fix is correct when it's using
Drupal.url('/admin/coffee/get-data')?Result:
This shows that the baseUrl shouldn't be added in front in some cases. Specifically, when it's using
Drupal.url, and in that case, the string should NOT have a leading/, either.I think it should be this:
Comment #42
solideogloria commentedThis applies on top of dev (which includes #36).
Comment #44
michaelmol commentedThanks!
Comment #45
laborouge commentedPatch 42 rejected on Drupal 9.1.5
Comment #46
solideogloria commented@laborouge It's not supposed to apply on 9.1.5. It applies on dev, because #35 was already committed to dev.
If you want the fix, you'll have to use the dev version of the module, or create a patch that applies so that you can use it in composer.patches.json.