jeffgeerling-com icon indicating copy to clipboard operation
jeffgeerling-com copied to clipboard

Drupal 10 upgrade woes - fix up the bugs

Open geerlingguy opened this issue 2 years ago • 5 comments

It's late, don't have time to fix everything from #151 now, so I'll leave some things to check on here:

  • [ ] Aggregate CSS/JS doesn't seem to work anymore. No errors, just... no generated CSS/JS in public files directory.
  • [ ] Insert module seems to... not be inserting. I was noticing a bunch of CKEditor-related JS errors in the console, not sure where those are coming from (I don't have CKEditor installed).
  • [ ] Emails on localhost weren't sending (though Simple Mail seemed to work otherwise...), not sure if it was a sendmail configuration issue (using MailHog locally), or something else. But need to test email sends on the prod server.

geerlingguy avatar Nov 03 '23 04:11 geerlingguy

Insert is definitely not working on Prod, either (just like on Dev).

Screenshot 2023-11-02 at 11 26 11 PM
ReferenceError: Can't find variable: CKEDITOR
TypeError: undefined is not an object (evaluating 'editorInterface.getInstances')

Maybe Insert is assuming the Text Editor module is loaded or something? This is a bare text input field.

geerlingguy avatar Nov 03 '23 04:11 geerlingguy

Simple Mail Queue seems to have grabbed the comment correctly after I posted it...

Screenshot 2023-11-02 at 11 28 14 PM

After cron run, message was gone from queue table, and no errors popped up in watchdog.

Screenshot 2023-11-02 at 11 31 40 PM

Email arrived okay! Formatting is wonky, but something in a recent Drupal upgrade caused that... it's not the fault of the Drupal 10 upgrade.

geerlingguy avatar Nov 03 '23 04:11 geerlingguy

For Insert, I think it's a bug in the Insert module, since it assumes CKEditor 5 is present and active... see Can't Insert images into textareas (without CKEditor)

I also tried adding CKEditor and allowing Image upload. It works fine... but if I upload an image at 2x resolution and resize it down, the width is reduced in the final markup but the height seems to get locked into the image's original height, which makes the image all stretchy and weird. Very odd behavior. Would be so nice if Allow image style to be selected in Text Editor's image dialog were part of Drupal core :)

geerlingguy avatar Nov 16 '23 00:11 geerlingguy

It looks like Insert may be fixed as of beta 3! I will try now; see the issue linked in the comment above.

Edit: Looks like it is not fixed in beta3. There's also a patch that may make it work though!

geerlingguy avatar Feb 05 '24 22:02 geerlingguy

Still not working with latest patch either :(

geerlingguy avatar Feb 21 '24 15:02 geerlingguy

Figured out the aggregation issue with CSS/JS:

--- a/files/vhost.conf.j2
+++ b/files/vhost.conf.j2
@@ -183,7 +183,7 @@ server {
         #rewrite ^/(.*)$ /index.php?q=$1;
     }
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* /sites/.*/(css|js|styles)/ {
         try_files $uri @rewrite;
     }
 }

However, JS still breaks on my main theme, at least logged in. Probably a JS ordering issue (you can assign different priorities, and I'm guessing it's aggregating with some function unable to access a var that should be set.

geerlingguy avatar Jan 09 '25 02:01 geerlingguy

All issues (except for JS aggregation are fixed now — Insert seems to be working correctly now too... maybe it was a PHP version bug, or filesystem permissions, or who knows what!

geerlingguy avatar Jan 09 '25 17:01 geerlingguy