Fix Unexpected Behavior When Impersonating Users
In certain cases, like with the
Workarea::MultiSite plugin, impersonating users can cause unexpected behavior because the impersonation status check can run before multisite changes the database. This change moves that status check (called
:check_impersonation) above any other manipulation of the session by way of the
prepend_before_action method, to prevent issues like this from happening in the future.
Make Orderdataintegrationtest Less Great Again
This test was originally named
Storefront::OrderDataIntegreationTest, and thus caused issues when decorated due to the file name and class name not matching up. We've renamed the class to
While the test is ostensibly much less great due to this change, it does allow implementers to decorate its methods, thus improving its usefulness in our platform.
Discovered by "The Reformed" Francisco Galarza
Prevent Duplicate ID Errors When Editing Featured Products In Category And Product/variant Details
Duplicate ID errors were occurring in certain cases on the featured products forms, catalog product workflow, and variant forms. Since Rails will (by default) set IDs on each DOM element we are creating with its tag helpers, we're now passing
id: nil so IDs are not generated at all.
Discovered by Kristin Henson in featured category products, with an important assist by Kristen Ward , who reported the issue in product/variant details.
Use Fully-qualified Url For Homepage Open Graph Image Tag
Content pages were still using the
image_path syntax to render URLs tothe logo image. This wasn't working on social media networks, whereinthe URL lookup would result in an error. Changing this to
image_url,which incorporates the host, allows pages to be shared on social media.
Discovered by Kristin Henson.
Prevent Error When Svg File Cannot Be Found
In the base implementation of
InlineSvg, it would seem that locally, we assume that an SVG file is present in Sprockets, and if it isn't an error occurs. This
NoMethodError is difficult to reason about as a developer, so we're rescuing and treating the response as if we're missing the SVG, leveraging the existing system in place for handling that error.
Discovered by Matt Dunphy.
Submit New Content Preset Inline Form Asynchronously
The "add content preset" form shows up in a tooltip, and when creating a new content preset within a workflow, the form submission refreshes the page and knocks the user out of the workflow. We've remedied this by making the form submission asynchronous, so the page won't refresh and the workflow won't get broken. Results of the operation are showed in either an error or success flash message.
Lock Down Rufus-scheduler
Rufus::Scheduler library that
Sidekiq::Cron uses for parsing schedule information refactored some of their codebase, and as a result caused a breaking change in the
Sidekiq::Cron library. The fix for this has not been released yet, so we've made sure to lock down the rufus-scheduler gem to a slightly lower version in order to avoid this issue.
Remove Currency From Structured Pricing Data
workarea/storefront/products/_price partial, we were returning the full currency with the price in the
price data point. We're now returning the numerical value of the price without its currency, as it's already denoted above in
Discovered by Kristin Henson
Fix Wcag Issues After Axe Accessibility Audit
After performing the WCAG 2.0 accessibility audit with aXe, we fixed a large amount of accessibility issues in the admin and storefront, such as missing
aria- attributes and
role definitions for the vast array of elements on each page. This change affects both admin and storefront, and should prevent issues on future accessibility scans as a whole.
Prevent Duplicate IDs When Editing Content Blocks
By default, the Rails form helper tags will generate an ID based on the
name attribute of the element and the name of the `
tag it's surrounded by. Because fieldsets within the same form sometimes share names, we used thedom_id()
helper method to generate mostly-unique DOM IDs for each element. As we gradually shifted to a more asynchronous and feature-rich content editor, it was observed that duplicate IDs were appearing on the page for different fieldsets, or sometimes the same fieldset rendered multiple times in a content block. To prevent this, we're now settingid: nil
on all tags that previously had adom_id` associated with it. This will ensure that Rails won't generate an ID onthe DOM element, which is not necessary given the way we handle styling and behavior for elements on the page.
Fix Broken Tests When Activemerchant Gateway Connected to Real Url
In a recent update to ActiveMerchant, a refinement on the
Net::HTTP library was made to log additional SSL connection details, in accordance with a future PCI compliance restriction. This had the effect of breaking some tests in a client build, which had some integration tests set up to work with
VCR. VCR's usage of
Webmock, and the way Webmock ensures
Net::HTTP doesn't actually make HTTP requests, caused a
NoMethodError in tests. This has been resolved upstream, so once a new version of ActiveMerchant is released, we'll remove this change from the platform and depend on the higher version.
Discovered by Joe Giambrone.