Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-16740

No possibility to select "no premium image"

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.4
    • Fix Version/s: 4.7
    • Component/s: CiviContribute
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      On the premium configuration page, when you select "no image", the saved setting is an image whose URL is "/". This is not "no image" but "an image located at /", which is incorrect. Tested on CiviCRM 4.6.4 with Wordpress, but it is probably plateform-independant.

      I fixed it locally but I never submitted a patch to CiviCRM, so below is the fix and I will try to submit myself the patch in the next weeks. The issue comes from the fact "no image" should be stored as an empty URL but, during the saving, the URL is normalized and an empty URL is not kept as it but replaced by "/" during the normalization.

      In class CRM_Contribute_BAO_ManagePremiums, in function add, replace:

      • if (isset($params[$key])) {
        + if (isset($params[$key]) && $params[$key]) {

        Attachments

          Activity

            People

            • Assignee:
              yashodha Yashodha Chaku
              Reporter:
              seb35 Seb35
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 15 minutes
                15m
                Remaining:
                Remaining Estimate - 15 minutes
                15m
                Logged:
                Time Spent - Not Specified
                Not Specified