GithubHelp home page GithubHelp logo

Comments (9)

jaapjansma avatar jaapjansma commented on July 20, 2024 2

I have the same issue and discovered the cuase in the boilerplate code generated by civix.

in polyfill.php a check is done whether the mixin function has already run. This is the case when you have multiple extensions enabled in CiviCRM.

Change polyfill.php from

foreach ($mixins as $mixin) {
    // If there's trickery about installs/uninstalls/resets, then we may need to register a second time.
    if (!isset(\Civi::$statics[__FUNCTION__][$mixin])) {
      \Civi::$statics[__FUCTION__][$mixin] = 1;
      $func = $_CIVIX_MIXIN_POLYFILL[$mixin];
      $func($mixInfo, $bootCache);
    }
  }

to

foreach ($mixins as $mixin) {
    // If there's trickery about installs/uninstalls/resets, then we may need to register a second time.
    if (!isset(\Civi::$statics[$longName][$mixin])) {
      \Civi::$statics[$longName][$mixin] = 1;
      $func = $_CIVIX_MIXIN_POLYFILL[$mixin];
      $func($mixInfo, $bootCache);
    }
  }

I will submit a patch for civix soon.

@totten or @colemanw does this make sense to you?

from civix.

ErikHommel avatar ErikHommel commented on July 20, 2024

I have the same issue: in older versions of CiviCRM my menu items disappear whenever I do a clear cache. And unlike above the civicrm/menu/rebuild?reset=1 does not bring it back

from civix.

colemanw avatar colemanw commented on July 20, 2024

Good detective work @jaapjansma - looks like the before version would cause multiple extensions to interfere with each other.

from civix.

jaapjansma avatar jaapjansma commented on July 20, 2024

Yes indeed it does. I did the discovery on a Civi 5.37 version.

from civix.

jaapjansma avatar jaapjansma commented on July 20, 2024

Ah and I see that I need to update the code in core and then update civix

from civix.

jaapjansma avatar jaapjansma commented on July 20, 2024

I have created a PR: civicrm/civicrm-core#25179

@colemanw are you able to review that PR?

After the PR is ok and merged we can update CiviX to load the fixed boilerplate.

from civix.

totten avatar totten commented on July 20, 2024

Well done @jaapjansma! The update works for me. Applied updates to both civicrm-core and civix.

from civix.

jaapjansma avatar jaapjansma commented on July 20, 2024

Thanks @totten

from civix.

jaapjansma avatar jaapjansma commented on July 20, 2024

Would it be wise to release new version of civix and inform the community through mattermost that an update of civix is advisable to do? So that extension developers get the new polyfill as soon as they work on their extensions with civix?

from civix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.