Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

In Progress [CPANEL-26496] Changing theme style via CLI causes display caching issues

Discussion in 'User Experience' started by Haym, Aug 26, 2017.

  1. Haym

    Haym Active Member

    Joined:
    May 12, 2017
    Messages:
    39
    Likes Received:
    5
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Hello,

    If a user changes their style via the cPanel interface, the cache is busted and the new style takes effect immediately.

    However if we change a user's style using the modify_accounts script, a hard refresh is required to clear the cache. This script should also trigger a cache bust in whatever way the change style UI does, e.g. query string number increment.

    Currently we cannot use the modify_accounts script because it's ineffective when users are seeing cached files which are set to expire after 2 months.

    Thanks
     
  2. Haym

    Haym Active Member

    Joined:
    May 12, 2017
    Messages:
    39
    Likes Received:
    5
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Note that the UAPI function Styles::update does not have this problem, the cache is cleared properly using this method. However this of course requires the user to have the Styles feature enabled. So I would definitely consider this to be a bug in the modify_accounts script.
     
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,008
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I've opened internal case CPANEL-15499 to report this behavior. I'll monitor this case and update this thread with more information as it becomes available.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. bellwood

    bellwood Active Member PartnerNOC

    Joined:
    Sep 25, 2012
    Messages:
    29
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    New York
    cPanel Access Level:
    DataCenter Provider
    When updating a systems users style via the CLI:

    /usr/local/cpanel/scripts/modify_accounts --theme=paper_lantern --all-users --style=basic

    Users that had been using a different style, e.g retro, are seeing a broken interface.

    The fix is to hard reload the page - varies by browser - and isn't intuitive for all end users.

    Not sure if this would be considered a bug - but - at the caching level, resetting the style should perhaps modify the cache control headers or send assets with an updated version string?

    This is on v78.0.18.
     
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,008
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @bellwood,

    I've reproduced this behavior internally and opened case CPANEL-26496 to report the issue. I'll update this thread with more information on the status of this case as it becomes available.

    In the meantime, one workaround you may find easier is to update the account's style with the following UAPI function via the command line:

    Code:
    uapi --user=username Styles update type=default name=basic
    The UAPI command will instantly update the style, though you'd have to create a loop bash command if you wanted to run it for all accounts.

    Thank you.

    Note: I also merged an older thread on this topic to this one and internally noted the previous case number in the new one.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. bellwood

    bellwood Active Member PartnerNOC

    Joined:
    Sep 25, 2012
    Messages:
    29
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    New York
    cPanel Access Level:
    DataCenter Provider
    Thanks for the quick response and workaround option @cPanelMichael
     
    cPanelMichael likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice