CRM-15263 civix doesn't add urls to info.xml

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.6
    • Fix Version/s: 4.5.1
    • Component/s: None
    • Labels:
      None
    • Documentation Required?:
      None

      Description

      Civix generated info.xml don't meet the requirements - I had to add this section to get it to upload as a release.

      <urls>
      <url desc="Main Extension Page">http://github.com/TechToThePeople/eu.tttp.excel</url>
      <url desc="Documentation">http://github.com/TechToThePeople/eu.tttp.excel</url>
      <url desc="Support">http://forum.civicrm.org</url><url desc="Licensing">http://civicrm.org/licensing</url>
      </urls>

      A couple of quasi-related thoughts / nice to haves if it makes sense to look at while delving into civix
      1) when I run phpstorm inspect code on civix generated shells I get a few things highlighted like invalid return statements & things. Would be nice if these weren't there as it would encourage better use of IDEs
      2) I add a versionAtLeast function to all my extensions to deal with interversion changes - should something like this be in civix / core?

      /**

      • is version of at least the version provided
        *
      • @param number $version
      • @return boolean
        */
        function _versionAtLeast($version) {
        $codeVersion = explode('.', CRM_Utils_System::version());
        if (version_compare($codeVersion[0] . '.' . $codeVersion[1], $version) >= 0) { return TRUE; }

        return FALSE;
        }

        Attachments

          Activity

          [CRM-15263] civix doesn't add urls to info.xml
          Tim Otten added a comment -

          civix v14.09.1 (which is now included in buildkit) adds the doc URLs.

          On the tangential points:

          1) I fixed some of the PHPStorm warnings but didn't touch the example "Report" template. That really should be an issue in its own right - pref for someone who knows the CiviReport coding practices better.

          2) Why do you need to a custom function for that? Seems like these would be equivalent:

          if (_versionAtLeast('4.4.2')) ...
          if (version_compare(CRM_Utils_System::version(), '4.4.2', '>=')) ...

          I suppose _versionAtLeast() is slightly more pithy, but it's not safe for concurrent extensions as-written, and I think we'd lose something in making it safe ("_mymodule_civix_versionAtLeast" doesn't have a very catchy name).

          Eileen McNaughton added a comment -

          hmm - perhaps adding

          CRM_Utils_System::versionAtLeast()

          • it doesn't save much code your on-liner but it would certainly save me time hunting a usage to copy each time I need to use it.

            People

            • Assignee:
              Tim Otten
              Reporter:
              Eileen McNaughton

              Dates

              • Created:
                Updated:
                Resolved: