πŸ‡ΊπŸ‡ΈUnited States @JasonSafro

Account created on 19 September 2006, over 18 years ago
#

Recent comments

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Same issue as the original reporter.

I'm logged in as superadmin UID 1. I have all the permissions at both the Drupal and Group Type levels. When I create a new group, I don't have access to it. Something is wrong here. Either the code is broken or there is some configuration step that's not clear.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

I encountered this problem with Drupal 11.1.1 and Group 3.3.3. The patch worked for me too.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

@catch You are right. My "fix" doesn't really fix the problem. My fix empties the output buffer before sending the Drupal content. That makes the problem go away.

Would you prefer a patch that checks the size of the output buffer and then does *something*? For example, check line 48 of web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php. I could replace:

// Current code.
$response->headers->set('Content-Length', strlen($content), TRUE);

with

// Proposed option.
// https://www.php.net/manual/en/function.ob-get-length.php.
$total_content_length = (ob_get_length() ?? 0 + strlen($content));
$response->headers->set('Content-Length', $total_content_length, TRUE);

I could also throw an exception if the buffer isn't empty or do something else if you have a good idea.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

I wrote a patch for a content-length issue I encountered. I'm not sure if the issues are related but here's the other issue: https://www.drupal.org/project/drupal/issues/3494148 πŸ› AJAX Response Not Sanitized For Length Active

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

This may be related to https://www.drupal.org/project/drupal/issues/3494148 πŸ› AJAX Response Not Sanitized For Length Active . If you are still experiencing this issue, please try the patch. Happy Drupaling!

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

@longwave proposed that we add some checks to tell programmers if there is extra whitespace in their files. This is an interesting idea. Personally, I think that test belongs in a linter. I'm open to discuss but have not been able to get ahold of @longwave.

I'm going to move forward with the solution that is ready to use. It resolves a difficult to debug issue that is tied to half a dozen tickets. I'd appreciate any feedback.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

@longwave @catch - Are either of you working on the solution that you discussed?

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

PHP Version 8.1.30
Drupal 10.3.6
BEF 7.0.2
VEFL 8.x-3.1

MR 6 did not work for me.
MR 5 is working great.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

@longwave You are not wrong. I'm not even sure what is "the real error". Is the real error that someone left some whitespace outside the PHP tags? Or, is the real error that Drupal sets content-length without accurately counting?

If there's a better solution, I'm all for it. But, I'd like to make some change. Debugging this error was not fun or easy.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Screenshot with notes to help in testing / debugging.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

@quietone Thanks!

πŸ› | Drupal core | test issue
πŸ‡ΊπŸ‡ΈUnited States JasonSafro
πŸ› | Drupal core | test issue
πŸ‡ΊπŸ‡ΈUnited States JasonSafro

jasonsafro β†’ created an issue.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Adding the following to web/core/lib/Drupal/Core/Ajax/AjaxResponse.php

  /**
   * Safely send headers and content.
   *
   * Empty anything already in the output buffer. Then, use the parent method
   * to send headers and content.
   *
   * @return $this
   */ 
  public function send(): static {
    ob_clean();
    return parent::send(); // TODO: Change the autogenerated stub
  }
πŸ‡ΊπŸ‡ΈUnited States JasonSafro

I re-tested this on Drupal 11. I cannot replicate the issue.

If anyone still encounters this problem, please feel free to re-open the ticket.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

I re-tested this on Drupal 11. I cannot replicate the issue.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

We are also seeing the issue in Drupal 10.2.7. @fskruez wrote a really good comment on the scope of the problem:

  • It is possible to create "orphaned" translations - translations of entities in languages that no longer exist
  • Patching Drupal to buffer against "orphaned" translations would require 100+ code changes

The attached patch does not let Drupal function with orphaned translations. Instead, it stops Drupal from deleting a language if this will result in orphaned content. A ounce of prevention is worth a pound of cure?

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

@sumitmadan We are also experiencing this issue.

How to reproduce?

Please re-read comment #4. TJMoyer did a good job explaining the situation that triggers this error.

How to fix

This is a PHP type error. See

protected function getViewSolrFile(string $filename, string $contents, bool $open = FALSE)

in .../search_api_pantheon/modules/search_api_pantheon_admin/src/Form/PantheonSolrAdminForm.php

The function is expecting the 2nd parameter to be a string. But, on line 77, you are feeding it at array. You need to:

  • Change the function definition to accept either an array or a string for $contents.
  • Enhance the function to handle the case where $contents is an array.
πŸ‡ΊπŸ‡ΈUnited States JasonSafro

JasonSafro β†’ created an issue.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Proposed solution attached. NOTE: this may need some additional CSS. I may add that after additional testing by team's QA.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Page is full of broken links.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

This should patch all the issues I encountered.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Page is not deprecated. The information about conditions is valid.

@theprodigy is correct. Queries do require an ->accessCheck() to work.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Here's the full error backtrace:

The website encountered an unexpected error. Try again later.

Error: Call to undefined method Drupal\Core\Url::getUrl() in social_group_social_user_account_header_create_links() (line 2575 of profiles/contrib/social/modules/social_features/social_group/social_group.module).

call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'social_group') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('social_user_account_header_create_links', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('social_user_account_header_create_links', Array) (Line: 160)
Drupal\social_user\Plugin\Block\AccountHeaderBlock->build() (Line: 171)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func_array('Drupal\block\BlockViewBuilder::preRender', Array) (Line: 111)
Drupal\Core\Render\Renderer->doTrustedCallback('Drupal\block\BlockViewBuilder::preRender', Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725 β†’ ', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 859)
Drupal\Core\Render\Renderer->doCallback('#pre_render', 'Drupal\block\BlockViewBuilder::preRender', Array) (Line: 421)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 240)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 165)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 166)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 183)
Drupal\Core\Render\Renderer->doRenderPlaceholder(Array) (Line: 712)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
Fiber->start() (Line: 720)
Drupal\Core\Render\Renderer->replacePlaceholders(Array) (Line: 597)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 240)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 153)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 154)
Drupal\Core\Render\Renderer->renderRoot(Array) (Line: 286)
Drupal\Core\Render\HtmlResponseAttachmentsProcessor->renderPlaceholders(Object) (Line: 135)
Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAttachments(Object) (Line: 45)
Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond(Object, 'kernel.response', Object)
call_user_func(Array, Object, 'kernel.response', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.response') (Line: 214)
Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object, Object, 1) (Line: 160)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Added a reminder to save the node to the Node: Create instructions.
 

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

The 'core_version_requirement' key must be present in info.yml files for D8.7+

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

This patch sets focus to the last element the user altered. It should probably be in an event handler or callback. If someone wants to improve this patch, please do.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Dynamic queries and entity queries are *almost* the same. I noted a key difference.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Commented my code.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Documentation recommends methods that do not exist. Updated documentation to suggest code that works.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

I came across this ticket while trying to solve the issue described in https://www.drupal.org/project/search_api/issues/3274158 πŸ› RuntimeException while trying to render item Active . I applied the patch.

Bad news: This patch did not resolve https://www.drupal.org/project/search_api/issues/3274158 πŸ› RuntimeException while trying to render item Active for me.
Good news: This patch did not cause any problems that I noticed. So that's something.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Please check https://www.drupal.org/project/drupal/issues/3352880 πŸ› Logic Error in Tables.php Active . I think it's related but different.

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Maybe update the error message with something like:

Before adding a facet, there should be a facet source. Facet sources can be:
- Drupal core's search.
- A view based on a Search API index with a page display.
- A page from the search_api_page module.
Production build 0.71.5 2024