[wp-trac] [WordPress Trac] #54443: Database Error Breaks "custom_css_post_id" Theme Mod

WordPress Trac noreply at wordpress.org
Thu Nov 18 10:19:36 UTC 2021


#54443: Database Error Breaks "custom_css_post_id" Theme Mod
---------------------------+------------------------------
 Reporter:  domainsupport  |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Customize      |     Version:  4.7
 Severity:  normal         |  Resolution:
 Keywords:  close          |     Focuses:
---------------------------+------------------------------

Comment (by domainsupport):

 Thank you for looking into this and I totally understand why you've marked
 it as "closed" ... however, if you would take the time to reconsider I
 would be most grateful.

 I've seen this occur now 3 or 4 times on two completely different sites
 with completely different hosting environments. Bearing in mind that I
 only look after a few hundred WordPress sites, this leads me to believe
 that the issue must be more common, worldwide, than one would imagine.
 After a quick Google, here is another likely victim for example ...
 [https://wordpress.org/support/topic/all-additional-css-is-missing/]

 The problem with the highlighted code is that if the CSS isn't found,
 whether it is there or not, it is then marked, as you say "no custom css".
 Which is great when there really isn't any custom CSS post for the ID in
 the option (not sure when this would be the case TBH) but not great when
 the post actually does exist.

 Is there a way to confirm that the custom css post was not returned from
 the database because it didn't exist and not because there was an error
 ... ?

 The reason why this location deserves the extra checks is that the outcome
 is so destructive to the site. I cannot think of another situation where
 if a database query is not successful (for whatever reason) then the
 outcome is so detrimental.

 Furthermore, although the css post isn't actually deleted, your average
 user wouldn't know where to look for it to restore their CSS!

 If you don't mind I will add to this thread if I see the problem re-occur.

 Many thanks,

 Oliver

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54443#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list