Joomla! Platform 12.3

Version 12.3 ("Curiosity") of the Joomla Platform was tagged and released on 20 December 2012. It is the third release of the 12.x series. In addition to numerous bug fixes, documentation updates and it also brings new features, the main ones:

  • Platform manual converted from DocBook to Markdown to improve readability and enhance contribution.
  • Extensive additions to the platform documentation.
  • Easier query construction with JDatabaseQuery::format
  • Support for composite keys in JTable
  • Improvements to the JGitHub API
  • Improvements to JLog around excluding categories and features for syslog
  • Improved Windows support for testing and building
  • PHPMailer updated to 5.2.2

The full list of commits is available here https://github.com/joomla/joomla-platform/commits/12.3 and the api doc here https://api.joomla.org. The Joomla! Platform Manual is available at http://joomla.github.com/joomla-platform/.

Project size

  • Classes: 305 (300 in platform 12.2)
  • Methods: 2187 (2136 in platform 12.2)

Summary of code quality

  • Check style: 123 warnings (124 in platform 12.2)
  • Test Coverage: 39.4% (38.16% in platform 12.2).

Documentation

New feature

Backward incompatibility

Style

Tests

Issue fixed

Refactoring

Update library

JavaScript

Deprecation

The following pull requests made by community contributors were merged:

  1. [#1767] Update documentation for 12.3 (pasamio)

    This pull request updates the documentation for 12.3's release.

  2. [#1556] Add JArrayHelper::invert (pasamio)

    This adds a new method to JArrayHelper called 'invert'. The 'invert' method provides the ability to provide an associative array of arrays and then make the values in those arrays the keys with the key from the input associative array as the value for those entries.

    So if we use the following code: php $input = array( 'New' => array('1000', '1500', '1750'), 'Used' => array('3000', '4000', '5000', '6000') ); $output = JArrayHelper::invert($input);

    The result for output would be equal to: php $output = array( '1000' => 'New', '1500' => 'New', '1750' => 'New', '3000' => 'Used', '4000' => 'Used', '5000' => 'Used', '6000' => 'Used' );

    This provides a quick means of a slightly more powerful 'array_flip' method where multiple values are concerned.

  3. [#1563] Add deleted & required _unix2DOSTime method (phproberto)

    Method _unix2DOSTime was in Platform 11.1 but does not exist actually.

    Is required by the method _addToZIPFile:

        // Get the hex time.
        $dtime = dechex($this->_unix2DosTime($ftime)); 
    

    Was removed intentionally? If so what is the replacement?

    We have to re-add the method or replace its call.

  4. [#1570] Style fixes to make code (more) readable. (ianmacl)

    Just cleaning up the code a little bit.

  5. [#1573] Set param for file to load with render method (mbabker)

    This change to JApplicationWeb::render() allows downstream users to set a file to load using the same methods as the template and params values are set with. For example, in the CMS, we would have to override this method to use the tmpl=component URL param. Now, it's just another param to set.

  6. [#1574] Fix typo in a comment (elinw)
  7. [#1589] Namespaces support for JLoader (florianv)
  8. [#1603] More JModelLegacyTests (dongilbert)

    I've added more tests for JModelLegacy. Specifically, I added and marked as incomplete all the methods that weren't tested yet and completed the __construct test as well as furthered the code coverage of the existing tests. There were some lines of some methods that were not being tested so I thought I'd start clearing that up.

  9. [#1612] Bootstrap/Import file fixes and disable GC during test runs. (LouisLandry)

    Cleaning up bootstrap/import files and adding gc_disable() to PHPUnit boostrap files to reduce the likelyhood of a PHP induced segfault during long running test suites.

  10. [#1631] Made time based test more forgiving. (ianmacl)
  11. [#1634] Fixed an issue in JApplicationWeb where the web app can generate a media URI with two slashes. (robschley)
  12. [#1636] Changing the PHPCS standard to use a submodule. (LouisLandry)
  13. [#1639] Update/edit some code standards details in the embedded docs (elinw)
  14. [#1641] Fixed remaining OAuth test time issues. (ianmacl)

    These accommodates tests that run on the edge of the second.

  15. [#1642] Updating coding standards. (ianmacl)

    Updated coding standards to repo HEAD.

  16. [#1643] Add a defaultType property to JCryptPassword (elinw)

    Add a default hash type property to JCryptPassword and implement it in JCryptPasswordSimple.

    Previously the default was always $2a$ (Blowfish), but with the the application can set (and get) a default. In the absence of a default being set Blowfish is used.

    This pull request also cleans up some small issue elsewhere in the class that emerged when testing and makes the argument name consistent in the interface and implementations to make it more readable.

  17. [#1644] Codestyle fixes (elinw)
  18. [#1645] Code style fixes. (ianmacl)
  19. [#1646] Code style issues in the test tree (elinw)
  20. [#1647] Remove patch method from JGithubHttp (mbabker)

    The patch method was added in to the parent JHttp class, making the method in the child JGithubHttp class no longer necessary. Additionally, since the methods have different declarations, this causes a E_STRICT error.

    Since the method is only used in the GitHub package, I've opted to totally remove the method instead of deprecating it. Essentially, this leaves no need for the child class at this time, but I've left it for the time being.

  21. [#1650] Update libraries/joomla/database/driver/sqlsrv.php (MDunkleSr)

    Change transactionStart to correct MS SQL syntax. Issue #1649.

  22. [#1651] Update libraries/joomla/database/driver/sqlsrv.php (MDunkleSr)

    Modify JDatabaseSQLSrv->insertObject to exclude null fields, thereby matching the behavior of JDatabase->insertObject. Issue #1648.

  23. [#1653] Cleaning up the Legacy Unit Test Tree (dongilbert)

    This PR completes the looooong task of getting the legacy unit test tree compliant with the Joomla Coding standards.

    See corresponding group discussion here - https://groups.google.com/forum/?fromgroups=#!topic/joomla-dev-platform/cLK-x6UY1yA

  24. [#1655] Incorrect chunksize calculation. Fixes Issue #1562 (dongilbert)
  25. [#1656] Fix code style line lengths in user agent strings (dongilbert)

    While continuing my code style cleanup in the unit test tree, I came across this rather large chunk of UA strings for the WebClient tests. They all (obviously) failed code style checks based on the line length, so I went ahead and broke these up as logically as I could, without extending the file length too much. If this is an acceptable approach, I'll continue doing it this way when line length code style errors arise - but I want to get feedback first to be sure.

  26. [#1657] Code style work in the testing tree (elinw)

    Cleaning up various things in the test tree including working on basic code sniff compliance, only using setUp and tearDown where needed and some work on docblocks and code quality.

  27. [#1658] More code cleaning in the test tree (elinw)
  28. [#1663] Fix grammar (elinw)
  29. [#1672] Cleaning up structure of JPathway Tests (dongilbert)

    Changing JPathwayTest to use a fixture. Each method currently creates a new instance ofJPathwayInspector, so I abstracted that to the setUp() method instead. Also moved inspector class to it's own file.

  30. [#1674] CS fix in database/query.php (dongilbert)
  31. [#1677] Update libraries/legacy/updater/adapters/extension.php (Bakual)

    The helper function "getClientInfo" takes two arguments, the search "$id" and "$byName" which decides if it should search by id or name. In our case here we want to search by the name and thus it should be set to "1". Otherwise the function will return null and break all extension updates if the client tag is set instead of the client_id in the updater xml.

  32. [#1678] Convert manual to markdown. (ianmacl)

    This is the basis of the markdown manual as generated by Louis. I think we lost some changes so perhaps they'll have to be merged in or something.

  33. [#1680] Added menu to main repo. (ianmacl)
  34. [#1681] Pull request to move menu into main repo. (ianmacl)
  35. [#1685] Fixing up the loader after testing it. (LouisLandry)
  36. [#1686] Fix doc block for JRoute::_() (mbabker)

    As written, the doc block for JRoute::_() does not work as advertised. The 0 value advertised to use the current scheme never passes the if ((int) $ssl) check at line 76 in the unchanged file. As written, the only solid integer that is expected is a 1 for SSL schemes, so the parameter will accept any other integer for a non-SSL schemes. We can also look at making the 0 value work for the third param, but as written, the code would never accomodate for that anyways.

  37. [#1688] Fix incorrect JLog calls (Fix #1687) (elkuku)

    Some more extraneous SOME_ERROR_CODEs

  38. [#1689] Add docs section on Phar packaging. (eddieajau)

    Added a section to the docs introduction about using the Joomla Platform as a phar file.

  39. [#1702] Added missing menu links to Google and Keychain package documentation. (eddieajau)
  40. [#1704] JDatabaseDriverNosql changes for compatibility due to modifications to J...(okonomiyaki3000)

    ...DatabaseDriver

  41. [#1705] Clean any white spaces and/or tabs (mariopro)

    Tabs that may result from manifest source formatting after the translation element in

    COM_COMPONENT_SUBMENUNAME

    result in invisible bugs as the translation element is saved to the #__menu table with the tabs/white spaces. Translation will not be done and the alias will be used by the system to build the menu or submenu. Hard to debug, since white spaces and tabs are invisible in database. Suggestion is to trim both $menuElement and $child in the _buildAdminMenus method to avoid this issue.

  42. [#1709] Added docs for JProfiler class. (eddieajau)
  43. [#1714] Fix spelling (elinw)
  44. [#1720] sprintf complains unless the correct number of arguments are passed (okonomiyaki3000)

    An undefined variable was being passed to JText::sprintf in two places. This was fixed a little while ago, in one case it was replaced but in another it was omitted. Since sprintf throws a warning when the format uses numbered arguments but insufficient arguments are passed to the function... we need to pass something. Luckily, there is already a suitable string:JLIB_APPLICATION_ERROR_COMPONENT_NOT_FOUND

  45. [#1723] Implement Countable in JData and various fixes (florianv)

    Implement Countable in JData Remove unused variables Change instanceOf to instanceof Defaulting depth = 3 in JDataDumpable as it is in JData and JDataSet

  46. [#1724] fix spelling (Yehonal)
  47. [#1728] Fix some grammar. (elinw)
  48. [#1736] Add some new tests, clean up some others. (elinw)

    This adds tests to a number of classes and also reorganizes some to be more useful (for example separating into separate tests so all assertions are tested regardless of failures of other assertions) including JFactory, JApplicationBase, JSession, and JUserHelper.

  49. [#1740] Improve docblock, add type hinting and default null to JSession::getInst... (elinw)

    ...ance.

  50. [#1743] fixed bug in JUser Bind not checking value correct (fanno)

    Also added userbind test ? not 100% sure this would work as this is my first ...time making this. i need someone that understand the test envioment to try it.

    Hope you understand

    -Thanks

  51. [#1747] Fix typo in doc block (elinw)
  52. [#1748] fixing tested for windows system (fanno)

    This pull request is not done yet, i am still having some issues with the tester

    21) JFormTest::testAddRulePath Line:142 The libraries rule path should be included by default. Failed asserting that false is true.

    C:\Users\fanno\data\Projects\workspaces\phpstorm\joomla-platform\tests\suites\unit\joomla\form\JFormTest.php:143

    now the issue is this ..

    $valid = JPATH_PLATFORM . '/joomla/form/rules';

    $valid is (C:\Users\fanno\data\Projects\workspaces\phpstorm\joomla-platform\libraries/joomla/form/rules)

    and the path inside $paths is

    C:\Users\fanno\data\Projects\workspaces\phpstorm\joomla-platform\libraries\joomla\form/rules

    this comes from https://github.com/fanno/joomla-platform/blob/staging/libraries/joomla/form/helper.php#L302

    I am well aware that the user of DS is not needed anymore, however it complicates the testing

    it could posible be solved by doing something like

    $valid = realpath(JPATH_PLATFORM . '/joomla/form').'/rules';

    however i think it is ugly but it it works it works ...

    is this how the test should be made to look ? or how do you want to deal with it ?

  53. [#1753] JImage Docs (dongilbert)

    Adding documentation for the JImage package. Includes method parameters, code examples, etc...

  54. [#1761] Update PHPMailer to 5.2.2 (mbabker)
  55. [#1763] Cleaning up formatting in JImage Docs (dongilbert)

    This fixes some of the formatting issues in the JImage Docs

  56. [#1756] Fix unit tests for PHP 5.4 (elkuku)

    Currently the unit tests are failing when run in PHP 5.4 with it's standard options trying to teach us how to write better code: PHPUnit_Framework_Error_Warning : Creating default object from empty value This fixes those nasty messages.

  57. [#1752] Adding Platform Manual link to README (dongilbert)

    I also update the link to the contributing guide.

  58. [#1701] Adding destroy() method to JImage (dongilbert)

    Currently, there is no way to release memory associated with a JImage::$handle resource. When working with images, it's normally accomplished using imagedestroy($handle), but since the resource is held within the JImage object instance, we don't have access to destroy it and free the memory. This fixes that by allowing you to explicitly destroy the image handle.

  59. [#1744] Add a CONTRIBUTING file to the repo (mbabker)

    GitHub allows you to have a CONTRIBUTING file in your repo, which when present, adds a notice above the input area for new issues and pull requests linking to the file and contains some guidelines for contributing (see https://github.com/joomla/joomla-cms/issues/new for an example of this).

  60. [#1739] Change registerPrefix and registerNamespace to LIFO (dongilbert)

    When registering a prefix or namespace, the last path registered should be the first path searched. This would make overriding classes MUCH easier.

  61. [#1730] Fix bug in `JDataSet` when unsetting within a foreach loop. (eddieajau)

    The use of offsetUnset on the current iterator point within a foreach loop was causing unpredictable results. If the current pointer is being unset, the pointer is moved back one unless it's the first element of the array, in which case the pointer is set to false. The next method then checks for this special case offalse and rolls to be 'first' element of the array (which would have been the 'next' one if the offset had not been unset).

    This PR also adds a new clear method to reset the contents of the set, and a keys method that works in a similar way to the array_keys function.

    Tests and documentation have been updated accordingly. The tests on JData::count are also consolidated.

  62. [#1718] Allowing JDatabaseDriver::quote to take an array of strings. (eddieajau)

    If supplied with an array of strings, the quote method will return an array of quoted strings. If neither a string nor array is passed to the quote method, an exception is thrown. Added documentation for the escape and quote methods. Updated unit test.

    This avoids having to do something like the following every time you need to deal with an array:

    php $db = JFactory::getDbo(); $q = $db->getQuery(true); $closure = function (&$v, $k) use ($q) { $v = $q->q($v); }; array_walk($strings, $closure);

  63. [#1731] Improved documentation for the JInputFiles class. (eddieajau)
  64. [#1716] Update libraries/joomla/document/feed/renderer/rss.php (jan7923)

    Fix for: RSS feed gets corrupted when ampersand (&) or other escapable characters exist in Site Meta Description

    Bug filed here: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=29731

  65. [#1722] Consolidating duplicate code checks into isSupported() method (dongilbert)

    8 lines of code were duplicated across every JImageFilter* class in the execute method to determine whether or not the imagefilter function existed. Seemed a little ridiculous to me, so I consolidated the check into it's own isSupported() method, and call that instead.

  66. [#1712] New Data package (eddieajau)

    Overview

    This pull request adds a Data package with two new classes: JData and JDataSet.

    While similar to the familiar JObject class, the get and set methods are removed in favour of using direct property accessors ($object->key) that are controlled by magic methods. The properties are held in a private array within the class, completely separate from the real class properties. ThesetProperties method is replaced with a bind method which is used elsewhere in the API (cf. JTable->bind). A 'dump' allows you to obtain a stdClass representation of the data object. This is also used to make the class implement the JsonSerializable interface.

    JData can also act as an array iterator allowing you to use it in a foreach construct.

    The JDataSet class provides a convenient way to work with lists of JData objects. Aside from the regular iterator functionality, the magic get method acts like a "get column" operation on the entire list, and the magic set method acts like a "set column" operation on the entire list. The magic call method allows you to call a method (if available) on each of the objects in the list. See the documentation for more information.

    Additional notes and comment can be found in the documentation.

    This PR supersedes #1673 (and #1703) which looked at making improvements to the existing JObjectclass. After review, it was found reasonable to incorporate the proposed new features and architecture in a new package thereby allowing JObject, an artefact of bridging work between PHP 4 and PHP 5, to be deprecated at some point in the future (such work does not form part of this pull request and will be left for others to pursue).

    Documentation

    Documentation is provided with the pull request.

    https://github.com/eBaySF/joomla-platform/blob/data-package/docs/manual/en-US/chapters/packages/data.md

    Some historic information on JObject is also provided:

    https://github.com/eBaySF/joomla-platform/blob/data-package/docs/manual/en-US/chapters/packages/object.md

    Business Case

    The JObject class has severe limitations when trying to merge domain logic with a value or data object patterns. This can be seen in classes like JTable and particularly JUser where you need to perform some coding gymnastics to avoid column mismatches when saving to the database. To this end, we needed a better way [for eBay applications] to interact with the value object itself, and also so it could interact with a Data Mapper pattern (a long term alternative/replacement for the JTable-way of doing things) so that the value object could remain independent of the data source (unlike JTable which is a value object that is tightly coupled to a specific datasource).

    JData and JDataSet provide a convenient way for working with structured, semi-structured and unstructured data.

  67. [#1719] Fixing namespace unit test failure (dongilbert)

    I found a problem in the JLoader Namespacing feature - if a class is already loaded, the autoloader includes the file again anyways.

    I download the latest zip of the platform to make sure I didn't break it locally, and got the same errors. This PR fixes the issue by adding a class_exists($class) check to the loadByNamespace* methods.

  68. [#1708] Fix some doc block issues in JUser (elinw)
  69. [#1640] Handle nested transactions (okonomiyaki3000)

    Transactions need to support 'nesting' (actually save points) so that mistakes like this don't happen:

    ```php $db->transactionStart();

    // do stuff

    SomeFunction();

    // oops, need to rollback for some reason $db->transactionRollback(); // Oh no! It was already commited because:

    /****** Elsewhere... ********/ function SomeFunction() { // I don't know that we already started a transaction so I'll try to start one. $db->transactionStart();
    // Hmm. Seems fine. Do stuff.

    // All good, let's commit. I think I'm just committing my stuff because I don't know anything!
    $db->transactionCommit(); 
    

    } ```

    I'm sure this situation never happens in Joomla but let's make sure it never can happen.

    Like this: ```php $db->transactionStart(true); // In case there is currently no transaction, this works as it always has

    // do stuff

    SomeFunction();

    // oops, need to rollback for some reason $db->transactionRollback(true); // No problem, because:

    /****** Elsewhere... ********/ function SomeFunction() { // I don't know if we already started a transaction so I'll try to start one with the savpoint flag just in case. $db->transactionStart(true);
    // Hmm. Seems fine. Do stuff.

    // All good, let's commit. I'll commit with the savepoint flag so as to not step on any transactions that may be 'enclosing' this one.
    $db->transactionCommit(true); 
    

    } ```

  70. [#1696] New string in libraries/joomla/html/behavior.php (infograf768)

    This patch for CMS http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=29669

    lets get a nice message with the name(s) of the required fields concerned when not filled correctly, and not the uninformative js Alert.

    For this, we need to add a string in behavior.php

  71. [#1591] Namespaces support for JLoader (florianv)

    This pull request adds support for class loading and autoloading based on namespaces.

    If your class is located in : BASE_PATH/Chess/Piece/Pawn.php :

    ```php <?php namespace Chess\Piece;

    class Pawn {} ```

    You can register it to the auto loader, by registering the ROOT namespace Chess:JLoader::registerNamespace('Chess', BASE_PATH . '/Chess');

    All classes respecting the naming convention in a given namespace : namespace Folder\SubFolder;for classes in BASE_PATH/Folder/SubFolder/ will be autoloaded.

    If you have lower case directory names and class names BASE_PATH/folder/subfolder/, you can either declarate the namespace with lower or camel cases, and it will work too.

    But note that the first param of JLoader::registerNamespace is case sensitive and must match the namespace declaration case.

    Examples: namespace Chess; JLoader::registerNamespace('Chess', PATH_TO_CHESS);

    namespace chess; JLoader::registerNamespace('chess', PATH_TO_CHESS);

    You can also register multiple lookup paths for a given namespace (like the prefix).

  72. [#1695] Fix codestyle issues (elinw)
  73. [#1693] Add the coding standards to the menu after restructuration (elkuku)

    As discussed on #1680 This adds the code-style section to the left menu.

  74. [#1683] Add a link to main repository in Platform documentation (javigomez)

    Simple improvement that links documentation to the main Github Repository. This help people reading the Platform documentation in external links like: http://joomla.github.com/joomla-platform/ to quickly find the main repository.

  75. [#1682] Updated history page in docs. (eddieajau)

    Added entry for 12.2. Added links to release notes.

  76. [#1679] Fix up remaining manual conversion from DocBook to Markdown. (LouisLandry)
  77. [#1671] Use PHP_EOL instead of \n in tests (okonomiyaki3000)

    The actual functions use PHP_EOL so the tests should also use them.

  78. [#1675] Add deprecation tags to legacy classes. (LouisLandry)

    Most of these have been marked for removal at 13.3. This is roughly a year of having them stick around in the legacy tree. My suspicion is that most -- if not all -- of these classes will end up being picked up and maintained by the CMS project for much longer than Q3 of 2013.

  79. [#1676] Checkstyle fixes. (ianmacl)

    Fix issues that broke the build.

  80. [#1667] Adding JRequest Tests (dongilbert)

    The JRequestTest class only contains tests for methods that are agnostic to the$_SERVER['REQUEST_METHOD'].

    I broke up tests specifically for $_POST and $_GET into their own classes,JRequestPostMethodTest and JRequestGetMethodTest respectively.

  81. [#1568] Keychain package (eddieajau)

    Overview

    The keychain provides a way to securely store sensitive information such as access credentials or any other data. This pull request contains a new class called JKeychain that extends JRegistry and supports encrypting and decrypting data through the use of public and private keys. It also provides the necessary command-line utility (a Joomla Platform application itself) to generate the key files.

    Documentation

    Documentation is provided in the pull request. A readable version is available at:

    https://github.com/eBaySF/joomla-platform/wiki/Keychain

    Business case

    At eBay, we needed a way to be able to store sensitive credentials (server/database logins, etc) in our SCM repository in an encrypted form without the hassle of sharing those credentials over email or other electronic means. The Keychain package was developed so we could store encrypted data in the source code repository (the security issues related to storing clear-text credentials in a semi-public, albeit internal, source code repository should be obvious). Engineers and deployment servers only need obtain the the 'shared key' manually, but only once. Should the credentials change, the encrypted data file in the repository simply needs to be updated and all engineers and servers have access to the new information on the next build.

  82. [#1665] Fix some methods in JTableNested when alias field does not exist. (elinw)

    The alias property always exists in JTableNested (it is explicit in the class definition) so the property_exists test will always return true. (In contrast the path and title properties only exist if the table includes those fields.) If an alias field does not exist, this will result in errors when it is referred to by name such as in the query in getRootId(). This change instead checks for the presence of a field called alias.

  83. [#1669] Fix E_STRICT error with child method declarations from JTable::_getAssetParentId()(mbabker)

    Resolves an E_STRICT error: Declaration of JTableCategory::_getAssetParentId() should be compatible with that of JTable::_getAssetParentId()

  84. [#1670] JForm::findFieldsByFieldset (okonomiyaki3000)

    Do not select elements nested within other elements.

  85. [#1606] Added composite primary key support to JTable. (ianmacl)
  86. [#1554] Fixing mysqli error message (obsidev)

    Store error message and error number before calling mysqli_ping (which would clean errors)

  87. [#1604] New function: JDatabaseQuery:format() (okonomiyaki3000)

    A sprintf-like function for building queries or query fragments.

    Usage: php $query->format('SELECT %1$n FROM %2$n WHERE %3$n = %4$a', 'foo', '#__foo', 'bar', 1); Returns: php 'SELECT `foo` FROM `#__foo` WHERE `bar` = 1'

    Maybe a more common use would be to make something like this: php $query = $db->getQuery(true); $query->select($query->qn('extension_id')) ->from($query->qn('#__extensions')) ->where($query->qn('type') . ' = ' . $query->q('file')) ->where($query->qn('element') . ' = ' . $query->q($element)); Into something like this:php $query = $db->getQuery(true); $query->select($query->qn('extension_id')) ->from($query->qn('#__extensions')) ->where($query->format('%1$n = %2$q', 'type', 'file')) ->where($query->format('%1$n = %2$q', 'element', $element));

  88. [#1608] fix documentation of insert function (thanks to foxession) (oc666)

    fix documentation of insert function. the usage example contained syntax error.

  89. [#1632] fix bug on stream transport http layer CMS#29565 (oc666)

    some servers put the headers inside wrapper data of the meta data instead in the wrapper data itself. thanks to Daniel K. from SiteGround for reporting this issue.

  90. [#1662] Complying with new 'WhiteSpaceBefore' Standard (dongilbert)

    This finally finishes code style fixing on the legacy tree, as long as more standards aren't added later. :p

  91. [#1661] Code Style Line Length Fixes (dongilbert)

    This PR replaces #1659 - that kind of got out of hand with me not being able to figure out what to do.

  92. [#1638] Support configurable facilities for JLogLoggerSyslog (pasamio)

    At the moment JLogLoggerSyslog is hard coded to use the "user" log facility. For Windows this is the only log facility available to the PHP syslog command however for every other system with standard syslog support there are alternative options.

    This change permits specifying other syslog facilities through a sys_facility option. The facilities supported are listed here: http://us1.php.net/manual/en/function.openlog.php

    An example of code which utilises this feature could look like this: php // Set up syslog JLog::addLogger( array( 'logger' => 'syslog', 'sys_ident' => 'jplatform_app', 'sys_facility' => LOG_LOCAL7 ), JLog::ERROR, array('databasequery') );

    That example logs to LOCAL7 any database query error with a custom identifier.

  93. [#1637] Shuffle PDO isSupported check (pasamio)

    At the moment a bit of work is done before the check for PDO checks if it is even supported. This shuffles some code around to move the checks further up the file.

  94. [#1431] Handling in HttpTransport when the requested uri does not exist (elinw)

    The transports are currently not handling it well when the domain for a requested uri completely does not exist. At this point they are somewhat inconsistent in what they do (e.g. stream silences the message and then throws an exception similarly to what I propose here for socket). Rather than use a generic exception message this uses php and curl errors to give more detailed information about what went wrong.

  95. [#1633] Adding JMail::IsHTML and have it return $this for chaining. Includes tests. (dongilbert)

    With the current implementation of JMail, you can't do something like this:

    JFactory::getMailer() ->addRecipient($to) ->setSubject($subject) ->setBody($body) ->addAttachment($attachment) ->IsHTML(true) ->Send();

    because PHPMailer::IsHTML doesn't support method chaining on the object. This PR fixes that.

  96. [#1635] Fix code style (elkuku)

    This will just add a bunch of empty lines ;)

  97. [#1627] Correct a class name JLoggerCallback => JLogLoggerCallback (elkuku)

    I believe the class name is wrong.

  98. [#1626] Fix broken module installation in Postgresql because of NULL constraint (vietvh)

    In Postgresql, if we have a column (TEXT NOT NULL) and we do not specify the column in INSERT, Postgresql will assume that column's value is NULL while MySQL will take it as empty string ''

  99. [#1623] Replace use of removed getActions method (mbabker)

    JAccess::getActions() was removed as part of the 12.3 cleanup, but it was still in use in a few places. This corrects that use.

  100. [#1620] Fixing store and retrieve factory state methods. (ianmacl)

    This will fix the issues with the legacy unit tests that are breaking the build.

  101. [#1619] Move the installer and updater packages to legacy. (LouisLandry)
  102. [#1615] Add JGithubAccount object (mbabker)

    This adds an account object to the GitHub package with methods to interact with the OAuth Authorizations API (http://developer.github.com/v3/oauth/) and the rate_limit end point (http://developer.github.com/v3/#rate-limiting).

  103. [#1609] Fix JTable::addIncludePath - includes tests (dongilbert)

    When passed paths that already exist in the $_includePaths array, JTable::addIncludePathmistakenly re-adds them. This is due to the fact that before !in_array($path, self::$_includePaths) runs, $path is converted to an array. This was to facilitate the ability to pass either an array of paths or a path string to the method. However, it also caused the in_arrayfunction to check $_includePaths as a multi-dimensional array, when it is only ever a single-dimensional array. This code fixes that behavior. I've included tests as well.

  104. [#1548] Add cleanRecursive method to JInputFilter + getAll method to Jinput (florianv)

    Some people inject directly all the data contained in $_POST in their models.

    It was possible with JRequest to retrieve all the data from a global var, but not with JInput, so I added the getAll method.

    I also added a doc comment for the 'hidden' properties, so the editor doesn't complain.

  105. [#1614] Added object connector for Github statuses API. (ianmacl)
  106. [#1613] Replace use of non-existant loadResultArray (Fix #1611) (mbabker)
  107. [#1599] Fix up test coverage for Github classes. (ianmacl)
  108. [#1601] JGithublabels management (nprasath002)

    JGithublabels management with unit tests

  109. [#1454] Prevent unit tests from fatally failing if database is not available. (aaronschmitz)

    Without these changes, all unit test crash when phpunit attempts to call a method on a null object.

  110. [#1465] Refactor the installer manifest classes to reduce duplicate code. (realityking)

    Also add unit tests for the new classes. Tests for the abstract base class tests will still have to be written.

  111. [#1508] Improve docblocks and add more type hints. (realityking)
  112. [#1518] Make JFormRule subclasses autoloadable. (realityking)
  113. [#1519] Typo: self::getJSObject to JHtml::getJSObject (hieblmedia)

    Fix for https://github.com/joomla/joomla-platform/pull/1475#discussion_r1555684 and https://github.com/joomla/joomla-platform/pull/1475#discussion_r1555688

  114. [#1520] Deprecate JTableSession and expression in JDocumentHtml::countModules() (realityking)

    Also avoid using eval in the non-deprecated case in JDocumentHtml::countModules().

  115. [#1521] Correct misleading docblock and log message (elinw)
  116. [#1522] Fix additional errors that show up in newer phpcs versions. (realityking)
  117. [#1525] Reduce phpmd warnings. (realityking)
  118. [#1528] Fix failing unit tests. (realityking)

    This isn't an error in itself but it breaks a unit test that relies on injecting a mock model into JViewLegacy.

  119. [#1531] Fix potentially broken code in JPagination (mahagr)

    Potential endless loop by setting $i=0 inside for statement. It's though much more likely that the code has no effect at all (I think it's always setting $i = $i), but even then it's probably a typo and will cause issues if the if statement gets changed at some point.

    See also: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=29197

  120. [#1532] Fix performance issues in JModelLegacy::_getListCount() (mahagr)

    Current code in JModelLegacy::_getListCount() forces database engine to fetch all items instead of just counting them. With hundreds of thousands or millions of rows the query gets very inefficient even if no results are actually fetched by the function.

    Cloning and modifying JDatabaseQuery object into COUNT(*) allows database engine to do optimizations that will considerably speed up the code even with very simple queries like:

    SELECT * FROM jos_users
    

    if there are hundreds of thousands of users.

  121. [#1533] Fix fatal error in JInstallerFile::uninstall() (mahagr)

    If there's error when parsing uninstall SQL from manifest, $db->stderr(true) gets run before $db is defined.

  122. [#1535] Add Windows support for the build file (hieblmedia)

    The jdk runtime on windows is looking of .exe files instead of .bat files. So it is required to add the suffix.

  123. [#1536] Fixing PHPCS error (pasamio)

    This pull request resolves a PHPCS error I missed during a merge.

  124. [#1592] Consistent use of XML values for fields 'readonly' and 'disabled' (benjaminpick)

    As I said in #1188, this should be implemented in all field implementations (including joomla-cms).

  125. [#1598] Simple fix on JCryptPasswordSimple class (diegovarussa)

    Fix error: Fatal error: Call to undefined method JCrypt::getRandomBytes() in /var/www/jplatform/libraries/joomla/crypt/password/simple.php on line 102

  126. [#1594] Fixing HTML Tabs (obsidev)

    Removing quotes in HTML Tabs in order to remove a javascript error.

  127. [#1595] Added JGithubMilestones (ianmacl)

    Milestones object to manipulate milestones on a github repo.

  128. [#1587] Loggers can be added which exclude specific categories (okonomiyaki3000)

    Also, unit test for adding loggers to exclude specific categories

    Suppose you want to separate your logs by category. Until now, it was only possible if you knew the names of all possible categories (which you don't). So now, let's say you want your deprecation logs in one place, your query logs in another, and all others someplace else. Then you just need to do this:

    php // Normal log files JLog::addLogger(array('text_file' => 'deprecated'), JLog::ALL, 'deprecated'); JLog::addLogger(array('text_file' => 'databasequery'), JLog::ALL, 'databasequery'); // Excluding categories JLog::addLogger(array('text_file' => 'others'), JLog::ALL, array('deprecated', 'databasequery'), true);

  129. [#1588] Completing tests for JModelLegacy (dongilbert)

    Here are the completed tests for JModelLegacy.

  130. [#1585] JHTMLBehavior::_calendartranslation rewritten for improved readability (okonomiyaki3000)

    Changed test to reflect that '/' is now escaped by json_encode

  131. [#1500] fix JModelLegacy __construct method to determine option (dongilbert)

    Line 216 of JModelLegacy will incorrectly parse your model class name if your model class ends in model. I had a situation where I was building an auto manager for a client, and one of the models was named AutosModelModel. The current regex parsed the classname and thought that the option was com_autosmodel, because it doesn't take into account the possibility that a model class can end in model.

    This pull request address issue #1499

    Note: This fix breaks backwards compatibility (potentially) because previously the regexp used the /i modifier, searching for case-insensitive strings. This new implementation uses case-sensitive strpos. Make sure your class names are properly CamelCased. (https://docs.joomla.org/Coding_style_and_standards#Classes)

  132. [#1067] Fix for issue 183 - allow additional characters in JFolder (aaronschmitz)

    Allowed characters based on http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words

    Additional characters allowed in JFolder names: ()[]{}#$^+.'~`[email protected]&=;, Disallow : in JFolder names

  133. [#1356] JFactory::getUser(0) returns null if session doesn't have JUser object (mahagr)

    We have had some bug reports like this:

    Fatal Error: Call to a member function authorisedLevels() on a non-object
    

    after running following code:

    $user = JFactory::getUser($userid);
    $accesslevels = (array) $user->authorisedLevels();
    

    More details from the bug can be found from here: http://www.kunena.org/forum/K-2-0-Support/123824-500-Internal-Server-Error

    After some inspection I found out that the function indeed returns NULL when $id = 0 and $instance = NULL. Please see my comments in the code below:

    ```php public static function getUser($id = null) // assume $id = 0 { $instance = self::getSession()->get('user'); // assume $instance = null

        if (is_null($id))                               // (is_null(0)) === false
        {
            if (!($instance instanceof JUser))
            {
                $instance = JUser::getInstance();
            }
        }
        elseif ($instance->id != $id)                   // Notice: Trying to get property of non-object
                                                        // (NULL != 0) === false
        {
            $instance = JUser::getInstance($id);
        }
    
        return $instance;                               // $instance === null
    }
    

    ``` I know that this can happen if session was broken, but can it happen in core if the session is valid, for example when user logs out?

  134. [#1582] Some more null to array() changes (elinw)
  135. [#1583] Fix checkstyle errors. (eddieajau)
  136. [#1584] Fix checkstyle warning. (eddieajau)
  137. [#1581] Fix code style in tests folder (elkuku)

    Some more style cleanup.

    ``` phpcs -np --standard=build/phpcs/Joomla tests/suites/unit/joomla/ ............................................................ 60 / 308 ............................................................ 120 / 308 ............................................................ 180 / 308 ............................................................ 240 / 308 ............................................................ 300 / 308 ........

    Time: 32 seconds, Memory: 16.50Mb ```

    :)

  138. [#1580] Fixing up a line ending issue. (LouisLandry)
  139. [#1579] Initial 12.3 Cleanup (LouisLandry)

    Just a little autumn cleaning. Removed code that was deprecated for removal in 12.3, fixed up some CRLF line endings that were in the codebase, fixed a few code style issues in the test tree, etc.

    Additionally the JPlatform class was modified to indicate that we are in 12.3 Dev status.

  140. [#1576] Fix two places using null instead of array() (elinw)
  141. [#1572] Replace use of undefined $error in JComponentHelper::_load (mbabker)
  142. [#1566] Improvments to getJSObject (okonomiyaki3000)

    Resources are ignored Object keys and strings are encoded with json_encode If the input array contains (php) objects, their values are used for recursion rather than the objects themselves (the function takes an array, not an object) Less string concatenation, more array implosion

  143. [#1408] [IMP] Plugin get overridable layout (phproberto)

    Helper function to ease the plugin layout overrides based on the JModuleHelper getLayoutPath function.

    For example the plugin Content - Pagenavigation will search his overrides in:

    template/YOUR_TEMPLATE/html/plg_content_pagenavigation

    And the default layout would be:

    plugins/content/pagenavigation/tmpl

  144. [#1413] Add a more complex truncate method (elinw)

    This method allows specification of a given length of plain text embedded in HTML of unlimited length when truncating. This offers a more complex option than the truncate method which allows specification of total length (number of character) of either plain text or html+plaintext.

    It also corrects some minor problems in the string.truncate method.

  145. [#1510] Correct docblocks in mysqli and pdo. (stefanneculai)

    As PHP documentations says mysqli and PDO do not return integers all the time. -mysqli::$insert_id: The value of the AUTO_INCREMENT field that was updated by the previous query. Returns zero if there was no previous query on the connection or if the query did not update an AUTO_INCREMENT value. Note: If the number is greater than maximal int value, mysqli_insert_id() will return a string. - PDO::lastInsertId: If a sequence name was not specified for the name parameter, PDO::lastInsertId() returns a string representing the row ID of the last row that was inserted into the database. If a sequence name was specified for the name parameter, PDO::lastInsertId() returns a string representing the last value retrieved from the specified sequence object.

    I have checked and insertid from the other database drivers and they return integers.

  146. [#1559] add support for redirect on installer helper (oc666)

    This is fix of bug #29374

  147. [#1564] sendMail automatically adds sender as replyTo (phproberto)

    Reference Tracker ID: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=29417

    Please notice me if accepted to apply the same fix to CMS.

  148. [#1565] Fixing build script so that the nightly works again and targets can be run individually.(ianmacl)

    A change was made a few weeks ago which caused the ant script to fail when individual targets were called (i.e. phpunit or phpcs). This pull request addresses this issue by setting the added property when the script gets parsed and not in a specific task.

  149. [#1557] Division by 0 in JCrypt (elinw)

    We have a report of division by 0 error [#29372] at line 210 (https://github.com/joomla/joomla-platform/blob/staging/libraries/joomla/crypt/crypt.php#L210) . A look at the code indicates that you would get $duration == 0 where $microStart and $microEnd are the same (and all the conditions for getting to that point are met, which would not be typical).

  150. [#1534] [IMP] Ensure that publish doesnt receive empty ids array (phproberto)

    Trying to disable the default item in Joomla CMS finishes in a JModelAdmin::publish with an empty ids array.

    http://awesomescreenshot.com/09ag6vbe3

    I'm going also to fix CMS to ensure that we do not call this method with an empty array.

    Joomlacode tracker issue: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=28990

  151. [#1541] Update to libraries/html/grid.php. Fixes grid.sort for components that use query strings in their URIs. (tholoksh)

    Some browsers will follow the "#" hyperlink generated by JHTML's grid.sort command unless the javascript onclick returns false. This will cause components with URLs that look like "index.php?option=com_example" to redirect to "index.php#", effectively breaking sorting functions. The commit adds "return false;" to the generated javascript in onclick. This affects at least frontend functions that use this in Joomla! 2.5.x

  152. [#1550] Update JRegistry::def to support not string defaults. (pasamio)

    This updates the behaviour of JRegistry::def so that it doesn't type cast the default value to a string but leaves it alone consistent with JRegistry::set's behaviour. This allows you to specify a default value that utilises an array of an object.

  153. [#1558] CMS [#25663] Fixes build admin menu item error while (re)installing componen...(pjwiseman)

    http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=25663

153 Pull Requests:

  1. elinw: 22
  2. dongilbert: 20
  3. ianmacl: 15
  4. eddieajau: 11
  5. mbabker: 10
  6. okonomiyaki3000: 9
  7. LouisLandry: 8
  8. realityking: 7
  9. elkuku: 6
  10. pasamio: 6
  11. mahagr: 4
  12. phproberto: 4
  13. florianv: 4
  14. oc666: 3
  15. obsidev: 2
  16. aaronschmitz: 2
  17. hieblmedia: 2
  18. fanno: 2
  19. MDunkleSr: 2
  20. benjaminpick: 1
  21. robschley: 1
  22. diegovarussa: 1
  23. stefanneculai: 1
  24. pjwiseman: 1
  25. tholoksh: 1
  26. Bakual: 1
  27. jan7923: 1
  28. javigomez: 1
  29. Yehonal: 1
  30. vietvh: 1
  31. mariopro: 1
  32. nprasath002: 1
  33. infograf768: 1

Merged By:

  1. LouisLandry: 73
  2. pasamio: 38
  3. ianmacl: 25
  4. eddieajau: 14
  5. realityking: 2
  6. florianv: 1