1. 10 Apr, 2019 1 commit
  2. 07 Apr, 2019 1 commit
  3. 05 Apr, 2019 2 commits
    • totten's avatar
      (NFC) Apply upcoming civicrm/coder policies (batch 2) · 5d4fcf54
      totten authored
      Method:
      
      * Checkout latest merged branch of civicrm/coder (`8.x-2.x-civi`)
      * Run this command to autoclean a batch of 100 files
        `PG=2 SIZE=100 ; find Civi/ CRM/ api/ bin/ extern/ tests/ -name '*.php' | grep -v /examples/ | grep -v /DAO/ | sort | head -n $(( $PG  * $SIZE )) | tail -n $SIZE | xargs phpcbf-civi`
      * Go through the diff. For anything that looks wonky, open in an editor and find a better solution.
      
      Note: The automated checker makes good points about awkward indentation, but the automated cleanup often makes it
      worse.  So that's why I have to open it up.
      5d4fcf54
    • colemanw's avatar
      Short array syntax - auto-format CRM directory · be2fb01f
      colemanw authored
      be2fb01f
  4. 05 Mar, 2019 1 commit
  5. 22 Feb, 2019 2 commits
  6. 18 Feb, 2019 1 commit
  7. 17 Feb, 2019 2 commits
  8. 16 Feb, 2019 1 commit
  9. 11 Feb, 2019 1 commit
  10. 01 Feb, 2019 1 commit
  11. 24 Jan, 2019 1 commit
  12. 22 Jan, 2019 3 commits
  13. 08 Jan, 2019 1 commit
  14. 07 Jan, 2019 1 commit
  15. 04 Jan, 2019 1 commit
    • totten's avatar
      (#635) Only write extra prevnext cache record if used · e37c68e1
      totten authored
      This line of code creates an extra record to facilitate clearing the
      SQL-based prevnext cache.  However, with Redis-based prevnext cache, it's
      not needed because the Redis implementation simply uses a TTL -- and (on
      Redis deployments) this lines to gratuitous SQL writes.
      e37c68e1
  16. 13 Dec, 2018 1 commit
  17. 04 Dec, 2018 1 commit
  18. 02 Dec, 2018 1 commit
  19. 01 Dec, 2018 1 commit
  20. 29 Oct, 2018 1 commit
  21. 24 Oct, 2018 1 commit
  22. 16 Aug, 2018 1 commit
    • totten's avatar
      (#217) PrevNext - Remove references to entity_table and entity_id2 from service · ec192197
      totten authored
      The PrevNext service/interface aims to be a replaceable component for use
      the search-caching (but not deduping).
      
      The interface that we produced from refactoring includes several references
      to `entity_table` and `entity_id2` -- these values are part of the SQL
      table, and they're needed for dedupe, but they don't seem to convey anything
      meaningful for search-caching.  Including these fields makes the interface
      more complicated -- which will make it hard to implement other variants.
      
      The general gist of this commit is that we no longer fill those two columns,
      and we no longer read them.
      
      In a couple functions, we split the new OOP implementation
      (`CRM_Core_PrevNextCache_Sql`) from the traditional static BAO
      implementation (`CRM_Core_BAO_PrevNext`) so that we can omit these fields.
      ec192197
  23. 07 Aug, 2018 1 commit
  24. 25 Jul, 2018 2 commits
    • totten's avatar
      (#217) PrevNext - Allow swapping `deleteItem()` for purposes of contact-search · 744b4e34
      totten authored
      The `deleteItem()` function is used by both contact-search and dedupe-merge use-cases. We can classify
      several of these just based on the files:
      
      * Contact-search use-cases. (These should be updated to use the interface.)
          * `CRM/Campaign/Selector/Search.php:     CRM_Core_BAO_PrevNextCache::deleteItem(NULL, $cacheKey, 'civicrm_contact');`
          * `CRM/Contact/Form/Search.php:          CRM_Core_BAO_PrevNextCache::deleteItem(NULL, $cacheKey);`
          * `CRM/Contact/Selector.php:             CRM_Core_BAO_PrevNextCache::deleteItem(NULL, $cacheKey, 'civicrm_contact');`
      * Dedupe-merge use-cases. (These should contiue using the BAO.)
          * `CRM/Contact/Form/DedupeRules.php:     CRM_Core_BAO_PrevNextCache::deleteItem(NULL, $cacheKey);`
          * `CRM/Contact/Page/DedupeFind.php:      CRM_Core_BAO_PrevNextCache::deleteItem(NULL, CRM_Dedupe_Merger::getMergeCacheKeyString($rgid, $gid, $criteria))`
          * `CRM/Dedupe/Merger.php:                CRM_Core_BAO_PrevNextCache::deleteItem(NULL, "{$cacheKeyString}_stats");`
      
      Additionally, there are two oddballs which are harder to categorize.
      
      * `CRM_Contact_BAO_Contact_Utils::clearContactCaches($isEmptyPrevNextTable = FALSE)` deletes *all*
        prev-next cache-records (`CRM_Core_BAO_PrevNextCache::deleteItem();`).  It only does so in one
        scenario (as part of `CRM/Contact/Import/Form/Preview.php`), which has this explanatory comment:
        "Clear all caches, forcing any searches to recheck the ACLs or group membership as the import may
        have changed it."
      * `CRM_Contact_BAO_Contact::deleteContact(...)` deletes any prev-next cache-records which
        reference a specific contact (`CRM_Core_BAO_PrevNextCache::deleteItem($id)`).
        I suppose this provides a low-grade form of referential integrity.
      
      Part of me thinks those should be re-considered (e.g.  to use a hook/event -- and reduce the
      coupling between `Contact` and `PrevNext` subsystems).  However, for purposes of #217, it
      seems OK to send `deleteItem(...)` to both BAO (SQL-only) and service (SQL-or-memory) variants.
      744b4e34
    • totten's avatar
  25. 24 Jul, 2018 1 commit
  26. 18 Jul, 2018 1 commit
    • Sean Madsen's avatar
      security/core#14 Validate "context" inputs · edc80cda
      Sean Madsen authored
      When "context" is passed as a GET parameter, ensure that its values is
      a valid "Alphanumeric" type. This helps prevent XSS when the "context"
      value finds its way into templates that lack HTML output encoding.
      
      Replace...
      
          CRM_Utils_Request::retrieve\((['"])context\1,(\s*)(['"])String\3
      
      ...with...
      
          CRM_Utils_Request::retrieve\($1context$1,$3Alphanumeric$3
      
      Also search for the following and manually fix:
      
          \$_GET\[(['"])context\1\]
          \$_POST\[(['"])context\1\]
          \$_REQUEST\[(['"])context\1\]
      edc80cda
  27. 17 Jul, 2018 1 commit
  28. 04 Jul, 2018 1 commit
    • eileen's avatar
      Simplify input params on OptionValue::addOptionValue · ff625280
      eileen authored
      The addOptionValue function is one we should probably deprecate/ remove but towards that we should
      start to remove it. This commit removes some complexity by passing option_group_name rather than
      groupParams - which is a more accurate reflection of usage and removes ambiguity around the passing
      by reference
      ff625280
  29. 15 Jun, 2018 1 commit
  30. 07 Jun, 2018 1 commit
  31. 30 Apr, 2018 1 commit
  32. 19 Apr, 2018 1 commit
    • totten's avatar
      (NFC) Update version in header · fee14197
      totten authored
      This is a simple administrative update to the headers. It was generated with the command:
      
      ```
      rgrep '| CiviCRM version 4.7' CRM/ Civi ang api bin extern install/ settings/ templates -l \
        | xargs sed -i'' "s/| CiviCRM version 4.7/| CiviCRM version 5  /g"
      ```
      
      Tthe inclusion of `|` aimed to avoid matching any non-header text (e.g. inline docs that
      mentioned the version incidentally). But then I did a looser search and for just
      
      ```
      rgrep 'CiviCRM version 4.7'
      ````
      
      and manually patched the remainder.
      
      Note: I'm not really keen on doing this every month, so I relaxed the header
      statement -- instead of `CiviCRM version 5.0`, it's just `CiviCRM version 5`.
      fee14197
  33. 16 Mar, 2018 1 commit
  34. 14 Mar, 2018 1 commit