Problem/Motivation

The website encountered an unexpected error coming which is -
Save Color Scheme - "The website encountered an unexpected error. Please try again later." (Error: Call to undefined function drupal_get_path() in at_color_scheme_form_submit() (line 98...)

CommentFileSizeAuthor
#8 drupal-get-path-3323932-8.patch601 bytesroshni27
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dribgnikcom created an issue. See original summary.

dribgnikcom’s picture

Title: Save Color Scheme - "The website encountered an unexpected error. Please try again later." » Save Color Scheme - "The website encountered an unexpected error. Please try again later." (Error: Call to undefined function drupal_get_path() in at_color_scheme_form_submit() (line 98...)

Error log shows the following:

Error: Call to undefined function drupal_get_path() in at_color_scheme_form_submit() (line 98 of /home/website.com/web/themes/contrib/adaptivetheme/at_core/forms/color/color_submit.php).

I guess I should post this bug at the Color module issues tracker. Please close.

dribgnikcom’s picture

Status: Active » Closed (won't fix)

drupal_get_path() is gone from Drupal 10, and the author of the color module needs to update the file to reflect the change.

markusk’s picture

Added link to related issue in color project queue.

markusk’s picture

Title: Save Color Scheme - "The website encountered an unexpected error. Please try again later." (Error: Call to undefined function drupal_get_path() in at_color_scheme_form_submit() (line 98...) » Save Color Scheme throws error (WSOD)

Shortened issue subject for readability.

Original subject was
Save Color Scheme - "The website encountered an unexpected error. Please try again later." (Error: Call to undefined function drupal_get_path() in at_color_scheme_form_submit() (line 98...)

bart lambert’s picture

Why won't this be fixed?
drupal_get_path() is removed and can't be called upon in D10.It is still present in the color_submit.php file which is part of AdaptiveTheme.
So as far as I understand it should at least be corrected here before we can carry on.

bart lambert’s picture

Status: Closed (won't fix) » Active
roshni27’s picture

Status: Active » Needs review
StatusFileSize
new601 bytes

please review the patch.

keshavv made their first commit to this issue’s fork.

keshavv’s picture

Thank you for the patch. But the patch will not work, Because it removed the trailing slash as well, Also there is one more occurrence.
So I have created the MR to fix issues from all places.
Please review,
Thank you.

shweta__sharma’s picture

Issue summary: View changes

Updated issue summary with the actual error.

bart lambert’s picture

After correcting the color_submit.php file according MR4! following error is thrown when I want to change te colors:

ArgumentCountError: Too few arguments to function Drupal\Core\Asset\CssOptimizer::__construct(), 0 passed in /data/sites/web/modelspoorhobbybe/subsites/empa2019.modelspoorhobby.be/themes/contrib/adaptivetheme/at_core/forms/color/color_submit.php on line 132 and exactly 1 expected in Drupal\Core\Asset\CssOptimizer->__construct() (line 34 of core/lib/Drupal/Core/Asset/CssOptimizer.php).

janoka’s picture

Reviewed: The code in the patch is good, as the previous error message has disappeared from the log.
Once applied, only the CssOptimizer error remains.
I think the patch covers the original bug.

sd123’s picture

Only the merge request works but it leads to the following error as commented earlier:

Uncaught PHP Exception ArgumentCountError: "Too few arguments to function Drupal\Core\Asset\CssOptimizer::__construct(), 0 passed in web/themes/contrib/adaptivetheme/at_core/forms/color/color_submit.php on line 132 and exactly 1 expected" at web/core/lib/Drupal/Core/Asset/CssOptimizer.php line 34" while reading response header from upstream

  • 98245ec8 committed on 8.x-5.x
    Issue #3323932 by roshni27: Save Color Scheme throws error (WSOD)
    
mattbloomfield’s picture

This has been fixed and will make its way into a new release later today

mattbloomfield’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.