Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-20821 & CRM-20938 - fix bugs in managing premium product images #10720

Merged
merged 9 commits into from
Jul 25, 2017

Commits on Jul 24, 2017

  1. CRM-20821 - Move resizeImage() to Utils class

    - Move resizeImage() from CRM_Contribute_Form_ManagePremiums to
      CRM_Utils_File
    - Make it public static
    - Don't change anything about how it works
    seancolsen authored and monishdeb committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    3cd6a7b View commit details
    Browse the repository at this point in the history
  2. CRM-20821 - Refactor resizeImage()

    - Clean up CRM_Utils_File::resizeImage()
    - No major functionality changes
    - Better docblock
    - Better error handling
    - Better variable names
    seancolsen authored and monishdeb committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    62b3b6e View commit details
    Browse the repository at this point in the history
  3. CRM-20821 - Refactor PremiumProduct BAO add()

    - Refactor CRM_Contribute_BAO_ManagePremiums::add
    - Don't change any functionality
    - Improve docblock
    - Use a $defaults array
    seancolsen authored and monishdeb committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    706f6a0 View commit details
    Browse the repository at this point in the history
  4. CRM-20821 - Refactor ManagePremiums postProcess()

    - Refactor CRM_Contribute_Form_ManagePremiums::postProcess()
    - No major changes to functionality
    - Eliminate deeply nested code (addressing "FIXME" comment)
    - Split code into multiple functions
    - Add more comments
    seancolsen authored and monishdeb committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    5459a6d View commit details
    Browse the repository at this point in the history
  5. CRM-20821 - Improve ManagePremiums formRule()

    - Improve CRM_Contribute_Form_ManagePremiums::formRule()
    - Require an image file, if "upload" is chosen
    - Remove the commented-out code for a rule which required images to be
      within a certain size
    - Minor refactoring to improve code clarity
    seancolsen authored and monishdeb committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    aa4ad33 View commit details
    Browse the repository at this point in the history
  6. CRM-20821 - Use smarter logic to adjust img URL

    This change is the crux of CRM-20821.
    
    Before this change, editing a premium product would automatically
    break the image URL. After this change, premium products can be edited
    while retaining the image URL. Functionality is preserved which changes
    the URL to a local URL when possible.
    
    This commit adds two new Utils functions (along with tests) to handle
    the logic of changing a supplied URL to a local URL.
    seancolsen authored and monishdeb committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    6c094ca View commit details
    Browse the repository at this point in the history
  7. CRM-20938 - Maintain aspect ratio in resizeImage()

    Make CRM_Utils_File::resizeImage() preserve image aspect ratio by
    default.
    seancolsen authored and monishdeb committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    ae969bc View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e0d4afb View commit details
    Browse the repository at this point in the history
  9. additional fix

    monishdeb committed Jul 24, 2017
    Configuration menu
    Copy the full SHA
    bb80d2f View commit details
    Browse the repository at this point in the history