Updater follows Location headers for valid archive filename #12817

Merged
merged 5 commits into from Nov 8, 2016

Projects

None yet
@milux
Contributor
milux commented Nov 7, 2016 edited

Pull Request for Issue #12816

Summary of Changes

Changed method "download()" of class "JoomlaupdateModelDefault", found in administrator/components/com_joomlaupdate/models/default.php.
The method does now fetch the HTTP headers of the update download location $updateInfo['object']->downloadurl->_data until the actual file (on AWS) is reached.
It further removes the path and the query string from the URL, resulting in the actual filename of the update package, which should work fine for all platforms.

Testing Instructions

Some people should check whether I messed up something for some specific platform setup.

Documentation Changes Required

none

Michael Lux made download() follow Location headers to resolve the valid filename…
… of the update archive
613a6c1
@wojsmol
Contributor
wojsmol commented Nov 7, 2016

@milux In a moment I'll be testing this PR.
cc @trzepiz @ot2sen @noras666 @brianteeman Please test this.

@wojsmol
Contributor
wojsmol commented Nov 7, 2016 edited

I have tested this item successfully on 613a6c1


OS Windows 8.1

#Fields: datetime   priority clientip   category    message
2016-11-07T16:11:17+00:00   INFO ::1    update  Update started by user Super User (410). Old version is 3.6.2.
2016-11-07T16:11:20+00:00   INFO ::1    update  Downloading update file from http://joomla-official-downloads.s3.amazonaws.com/joomladownloads/joomla3/Joomla_3.6.4-Stable-Update_Package.zip?[AWS patams].
2016-11-07T16:11:25+00:00   INFO ::1    update  File Joomla_3.6.4-Stable-Update_Package.zip successfully downloaded.
2016-11-07T16:11:27+00:00   INFO ::1    update  Starting installation of new version.
2016-11-07T16:11:49+00:00   INFO ::1    update  Finalising installation.
2016-11-07T16:11:49+00:00   INFO ::1    update  Ran query from file 3.6.3-2016-08-15. Query text: ALTER TABLE `#__newsfeeds` MODIFY `link` VARCHAR(2048) NOT NULL;.
2016-11-07T16:11:49+00:00   INFO ::1    update  Ran query from file 3.6.3-2016-08-16. Query text: INSERT INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description.
2016-11-07T16:11:50+00:00   INFO ::1    update  Deleting removed files and folders.
2016-11-07T16:11:56+00:00   INFO ::1    update  Cleaning up after installation.
2016-11-07T16:11:56+00:00   INFO ::1    update  Update to version 3.6.4 is complete.

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12817.
@ot2sen
Contributor
ot2sen commented Nov 7, 2016

I have tested this item successfully on 613a6c1

Applied the patch using patchtester to the 3.6.2 that couldn´t be updated yesterday.
After applying patch and running the update it completes and is now at 3.6.4


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12817.
@jeckodevelopment
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12817.

@joomla-cms-bot joomla-cms-bot added the RTC label Nov 7, 2016
@milux milux added this to the Joomla 3.7.0 milestone Nov 7, 2016
@zero-24
Contributor
zero-24 commented Nov 7, 2016

Hmm i'm not sure here. @mbabker can you take a look here?

@joomla-cms-bot joomla-cms-bot removed this from the Joomla 3.7.0 milestone Nov 7, 2016
@jeckodevelopment
Member

Waiting for review


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12817.

@joomla-cms-bot joomla-cms-bot removed the RTC label Nov 7, 2016
@milux
Contributor
milux commented Nov 7, 2016

@zero-24 The change could be problematic when the last observed location does not represent a file ending on ".zip". Is that possible? In that case I might check for proper file extension and append it manually if necessary...

@mbabker
Member
mbabker commented Nov 7, 2016

Well there are two options:

  1. Just remove the query string segment and leave it as the URL fragment without a file extension (probably bad news)
  2. Follow the headers to get the correct file name with file extension.

I don't think there's an issue here honestly, unless someone's got a scenario I'm not aware of to look at.

@zero-24
Contributor
zero-24 commented Nov 7, 2016

Thanks @mbabker 👍

@milux
Contributor
milux commented Nov 7, 2016

@mbabker

  1. Already tried that one... doesn't work, Joomla doesn't extract the file without proper file extension.
  2. Exactly what I did, however if the file from AWS doesn't end on ".zip", the process will fail

There are actually two more options:
3) Just remove the query string, check if the basename ends on ".zip", append if necessary
4) Resolve until destination and do the same thing as in 3)

So, what should it be? ;)

@mbabker
Member
mbabker commented Nov 7, 2016

Leave it as is. I wouldn't hardcode a .zip suffix check in the off chance the file extension ever changes (like if we tried serving the smaller .tar.* files instead of the ZIP package).

@ggppdk
Contributor
ggppdk commented Nov 7, 2016 edited

Leave it as is. I wouldn't hardcode a .zip suffix check in the off chance the file extension ever changes (like if we tried serving the smaller .tar.* files instead of the ZIP package).

administrator/components/com_joomlaupdate/restore.php
method: getUnarchiver()

it only supports: JPA, JPS, ZIP

@milux
Contributor
milux commented Nov 7, 2016

... with JPA and JPS being Akeeba-specific formats afaik, but how about a 5th solution:
5) We take the file extension from the original URL and append it to the basepath if it is not there yet. 😜

@milux milux added this to the Joomla 3.7.0 milestone Nov 7, 2016
@mbabker
Member
mbabker commented Nov 7, 2016

This is fine as is. Really we'd only have further problems if someone uploaded packages to AWS in the future without a file extension, in which case it'd probably be a broken file anyway. Plus our main interface to AWS is through the downloads site and is a Joomla extension, so the packages are going through validation on upload there. Let's roll with it.

@joomla/cms-maintainers When this is merged, I'd suggest tagging a standalone update for the update component since it looks like anyone hosting a production site on a Windows platform will have issues upgrading with packages pulled from AWS thanks to the URL query strings in both the XML update file and the resulting URL after following all redirects.

@milux milux removed this from the Joomla 3.7.0 milestone Nov 7, 2016
@ggppdk
Contributor
ggppdk commented Nov 7, 2016 edited

There is a rare problem (maybe not possible problem) that might occur with this PR

if the redirect/final URL does not have a query string (no character ?) then:

// Remove URL and query string
$urlBasename = basename($packageURL);
$basename    = substr($urlBasename, 0, strpos($urlBasename, '?'));

$basename will be empty, because substr will return an empty string, because strpos will give FALSE as length parameter

This should be safer :

// Remove URL and query string
$basename = basename($packageURL);
if (strpos($basename, '?'))
{
    $basename = substr($basename , 0, strpos($basename, '?'));
}
@ggppdk
Contributor
ggppdk commented Nov 7, 2016 edited

Please see my above comment

about adding zip as extension

  • only in the case that extension is not detected in the redirected URL, is a good sanity check,

Also we can try to grab the extension for the original update URL too,
Besides that is the purpose of &jcompat=my.zip , right ?

Is it preferable if no extension is detected that upgrade will fail ?
Plus currently as mentioned above, the getUnarchiver() only supports ZIP and joomla will not distrubute packages with JPA or JPS format

Michael Lux integrated suggestion of ggppdk, valid behavior if no query string
a5a8613
@milux
Contributor
milux commented Nov 7, 2016

@ggppdk Thanks for your suggestion, integrated that.
Because of what @mbabker suggested, I don't think that we need to hassle around with the extension any more.
Is this ready for RTC then?

@jeckodevelopment
Member

Needs tests again and it seems that Travis is not happy

jeckodevelopment and others added some commits Nov 7, 2016
@jeckodevelopment jeckodevelopment Merge branch 'staging' into coreupdate-filename-patch
330ead0
Michael Lux strict type checking
7395c87
@milux
Contributor
milux commented Nov 7, 2016 edited

Exactly... I just wonder how I made it unhappy? 🤔

+ $basename = basename($packageURL);
+ if (strpos($basename, '?') !== false)
+ {
+ $basename = substr($basename , 0, strpos($basename, '?'));
@mbabker
mbabker Nov 7, 2016 Member

This line, remove the space between $basename and the comma.

@milux
milux Nov 7, 2016 Contributor

Thanks, I didn't recognize this when copy-pasting the suggestion of @ggppdk

Michael Lux make Travis happy again... code style error
4c66273
@milux
Contributor
milux commented Nov 7, 2016

@jeckodevelopment Maybe now? 😉

@jeckodevelopment
Member

test test test 😄
thanks!

@wojsmol
Contributor
wojsmol commented Nov 7, 2016

I have tested this item successfully on 4c66273


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12817.

@milux
Contributor
milux commented Nov 7, 2016

I have tested this item successfully on 4c66273


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12817.

@milux
Contributor
milux commented Nov 7, 2016

@jeckodevelopment Done, for the sake of it. (There wasn't really a change, and yes, I actually tested it even though and didn't just press the submit test button. 😉 )

@jeckodevelopment
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12817.

@joomla-cms-bot joomla-cms-bot added the RTC label Nov 8, 2016
@jeckodevelopment jeckodevelopment added this to the Joomla 3.7.0 milestone Nov 8, 2016
@rdeutz rdeutz merged commit 7aa5e65 into joomla:staging Nov 8, 2016

3 checks passed

JTracker/HumanTestResults Human Test Results: 2 Successful 0 Failed.
Details
continuous-integration/drone the build was successful
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@joomla-cms-bot joomla-cms-bot removed the RTC label Nov 8, 2016
@nvyush nvyush added a commit to nvyush/joomla-cms that referenced this pull request Nov 9, 2016
@milux @nvyush milux + nvyush Updater follows Location headers for valid archive filename (#12817)
* made download() follow Location headers to resolve the valid filename of the update archive

* integrated suggestion of ggppdk, valid behavior if no query string

* strict type checking

* make Travis happy again... code style error
c583f65
@wojsmol
Contributor
wojsmol commented Nov 9, 2016 edited

Is it planned a new version of the com_joomlaupdate component with this fix before the release of Joomla 3.7.0?

@zero-24
Contributor
zero-24 commented Nov 9, 2016

@wilsonge @rdeutz any plans on this here?

@wilsonge
Member
wilsonge commented Nov 9, 2016

No. We only distribute com_joomlaupdate in exceptional circumstances - basically when we make break the updater in a release. All other modifications ship as per the usual release cycle of the CMS

@wojsmol
Contributor
wojsmol commented Nov 9, 2016

@wilsonge Without this fix com_joomlaupdate does not work under Windows. See #12817 (comment) and joomla/joomla-websites#742

@mbabker
Member
mbabker commented Nov 9, 2016

I would suggest someone publish a page with guidance for users on a Windows platform as they cannot direct download and upgrade if the decision is to not release an interim update for the component.

@trzepiz
trzepiz commented Nov 9, 2016 edited

@mbabker This is a big global problem for all Windows users and Windows servers. Should I tell everyone in Poland that "One click update" does not work on Windows?.

@mbabker
Member
mbabker commented Nov 9, 2016

It's fixed in the code for 3.7. I can't do anything about any other decisions.

@brianteeman
Contributor
@mbabker
Member
mbabker commented Nov 9, 2016

13% of sites sending stats in the last 60 days are Windows. How many of those are local dev versus production, we don't track, but that's definitely a higher use rate than other configurations we support.

@PhilETaylor
Contributor

13% ? wow... would be interested to find out how many were IIS and how many were XAMP - maybe the stats should log server type too ?

@wilsonge wilsonge pushed a commit that referenced this pull request Dec 15, 2016
@milux @mbabker milux + mbabker Updater follows Location headers for valid archive filename (#12817)
* made download() follow Location headers to resolve the valid filename of the update archive

* integrated suggestion of ggppdk, valid behavior if no query string

* strict type checking

* make Travis happy again... code style error
5b1b32d
@cpfeifer cpfeifer added a commit to cpfeifer/joomla-cms that referenced this pull request Dec 22, 2016
@cpfeifer cpfeifer Updating Fork (#1)
* Updated restore.php for updates

* Fix the generation of salt for crypt-blowfish

The salt for crypt-blowfish should be correctly formed as per the [php manual `crypt()` instructions](http://php.net/manual/en/function.crypt.php)

The expected size is at least 30 characters

* Pass hash crypt-blowfish without salt is length 60

* Increase Cost Factor for crypt-blowfish

Note that `getCryptedPassword()` and `getSalt()` are the old encryption methods

* Check to ensure user is not disabled before sending the email

* dont convert to integer - thanks @andrepereiradasilva

* Allow empty search - uses wrong value

* Updated installation language files

* 2fa handeling for mcrypt and openssl (#12497)

* handeling for mcrypt and openssl

* Language changes suggested bei Brian

* Prepare 3.6.4 Stable Release

* incorrect to check for an article

* space fixes

* SQL - FIELD_IN_SET() translation

[com_fields] - mysql dialect used FIND_IN_SET() #12636

* sql portability FIND_IN_SET()

sql portability FIND_IN_SET()

* portable SQL find_in_set()

portable SQL find_in_set()

* rename function to match CS rule

rename function to match CS rule
from  find_in_set() to findInSet()

* rename function to match CS rule 

rename function to match CS rule

* rename function to match CS rule

rename function to match CS rule

* prevent fatal error 

prevent fatal error on untranslated drivers

* delete old files from Joomla 3.2.3 version

delete old files in the update procedure

* remove option from config

* remove option from menu item

* mysql

* postrges

* sqlazure

* unit test

* Error in sr-YU installation ini file (#12984)

* Set correct default values for user creation in the backend (#12589)

* Update joomla.sql

* Update joomla.sql

* Update joomla.sql

* Updater follows Location headers for valid archive filename (#12817)

* made download() follow Location headers to resolve the valid filename of the update archive

* integrated suggestion of ggppdk, valid behavior if no query string

* strict type checking

* make Travis happy again... code style error

* Prepare 3.6.5 Stable Release

* Prepare 3.6.5 Stable Release

* Verify a pre-J3.2.1 crypt-blowfish without salt Password

* Improve the verification of a pre-J3.2.1 `getCryptedPassword()` Password

verify a pre-J3.2.1 Password that was hashed to crypt-blowfish without user specified salt

* verify a pre-phpass password hash

replicates the password hash creation used before 3.2.1 and #2683 implemented phpass

* Add one test with existing hash from old method

Good idea to include one existing hash rather than always generating a new hash for the test.

* Isis font-weight 200 override

* Update strings to be consistent with their use elsewhere in Joomla

* Make desc into a label

* Implement Countable interface in JFeed

* [com_content] - admin fix SQL error when apply empty filter

#13114

* models articles 

models articles fix

* model featured

model featured

* cs

cs

* ops

ops

* Check that extension that owns a category is enabled

* More calendar language files.

* changing en-US color to default en-GB colour

Easy fix on review
changing en-US `color` to default en-GB `colour`

* Fixing installation SQL for PostgreSQL

* Unit test fixes

* Fix placeholder showing "Select a User" when in readonly mode (e.g. modified_by) (#12627)

* Fix placeholder showing "Select a User" when in readonly mode (e.g. modified_by)

Additional changes:
- Remove obsolete extracted variables that are not present for this field type
- Correct variable name in doc block to match extracted name
- Refactor code to remove ternary overuse

* Changed getExcluded method return value to match doc block

Additional changes:
- Satisfy Code Sniffer (e.g. @since)
- Remove else block after variable initialisation

* Change htmlspecialchars($VARNAME, ENT_COMPAT, 'UTF-8') to $this->escape($VARNAME)

Additional changes:
- Change JHtml::script() call to JHtml::_('script' ...) to allow overrides via custom register method

*  Fix placeholder showing "Select a User" when in readonly mode (e.g. modified_by)

Additional changes:
- Change htmlspecialchars($VARNAME, ENT_COMPAT, 'UTF-8') to $this->escape($VARNAME)
- Refactor code to remove the ternary overuse
- Change JHtml::script call to JHtml::_('script' ...) to allow overrides via custom register method
- Correct variable name ($exclude) in doc block to match extracted name
- Remove obsolete extracted variables that are not present for this field type
- Removed the class suffix from the hidden field
- Remove (Fix) obsolete whitespace in class attribute for the visible field when no suffix was entered

* Move hidden field outside the condition for now

* Re-Added interface

Missed that in the manual merge process. While I was working on the PR, the custom fields code got merged. Thanks @wilsonge.

* Add custom class back to hidden field for potential b/c breaks

* Support for sqlsrv

* Mering calendar locales

* resolve conflict

* resolve conflict (reverted from commit 31e131f)

* resolve conflict

* [com_fields] No need for an alias in fields groups. (#13115)

* No need for an alias in fields groups.

* Remove alias from SQL structure.

* [com_menu] - delete reference on #_modules_menu deleting a menu item (#13126)

* Add a static flag to check if the event is registered (Fix #13124) (#13147)

* Coding style - com_newsfeeds (#13139)

* Leave one white-space before the PHP code closing tag.

* Fixed wrong place for space

* [plg_user] - delete messages from deleted user (#13052)

see #12883

* three more calendar languages

* Ensure we have a instance of JApplicationCms (#8166)

* Ensure we have a instance of JApplicationCms

This allows the creation of users via CLI scripts that currently error because the application object is an instance of JApplicationCli

* Change to method exists check

* [3.7.x] Input field invalid highlight (#12443)

* Session field invalid interger

* Input field invalid highlight

* Revert to original invalid highlighting

* [com_content] - deleted featured articles are not deleted from  #__content_frontpage table (#12505)

* [com_content] - deleted featured articles are not deleted from #__content_frontpage table

deleted featured articles are not deleted from #__content_frontpage table

* tabs

tabs

* tabs again

tabs again

* fully delete featured

delete featured from #__content_frontpage

* delete featured

delete featured

* moved to controller/models

moved to controller/models

* deploy version

deploy version

* 1 more space

1 more space

* travis CS

travis CS

* removed postDeleteHook() to solve conflicts

removed postDeleteHook() to solve conflicts and to make it better

* remove old pr way

remove old pr way

* implementation with a method override as suggested

implementation with a method override as suggested

* [NF] UX/UI Module menu assignment item type (#12752)

* Module menu assignment item type

UX UI improvment in module menu assignment to see menu item of type
separator, heading, alias

* add url type

* disabled attribute

* [categories] - respect  user level access for categories (#12931)

* [categories] - respcet  user level access

respcet category user level access

* [categories] - respect user access level

[categories] - respect user access level

* categories - respect user access level

respect user access level

* [categories] - respect categories access level when create a new article

respect categories access level when create a new article

* respect categories access level

search filter in article manager

* [com_installer] review config global default options (#12964)

* defaults

* sincronize with staging

* fix conflicts

* Regression: Bring back translateformat feature to JFormFieldCalendar (#12969)

* Regression: Bring back translateformat feature to JFormFieldCalendar

* Restore the missing part

* Two strings were missing in frontend.

* [com_menus] review config global default options (#12971)

* config.xml

* Update joomla.sql

* Update joomla.sql

* Update joomla.sql

* sincronize with staging

* fix conflicts

* Move the checkboxes to the leftmost column in detail view (#12997)

* [com_menus] - wrong group by when multilanguages enabled - postgresql (#12999)

Pull Request for fix regression from #12051 .

Summary of Changes

fixed wrong group by when multilanguages enabled

Testing Instructions

latest staging fresh multilanguage install

Go to Menu -> All menu items

* Displaying the correct tip in Global Configuration Permissions (#13143)

* Displaying the correct tip in Global Configuration Permissions

* simplification

* Disable Chosen.js for the rule field, again (#12877)

* Revert the check for instance type of data-chosen, to allow to disable Chosen for field with data-chosen="true"

* Add some explanation

* Replace deprecated isSite() and isAdmin() calls

* Fixed accidental replacements in tests

* Rev reverted replacements in external projects' files

* Corrected an oversight

* Resolve?

* Try to fix pagination-test failure

* Try to fix pagination-test failure, take2

* Try to fix pagination-test failure,  final (hopefully)

* Some more replacements

* Multilanguage: correcting saving menu item with same alias when language is changed to ALL (#13112)

* Multilanguage: correcting saving menu item with same alias when language
is changed to ALL

* not syncing anymore

* new string is no more necessary

* thanks @andre

* Coding style - PHP code tag and control structures (#13141)

* Leave one white-space after the PHP code opening tag.

* Leave one white-space before the PHP code closing tag.

* Fixed style for control structures alternative syntax.

* Removed unnecessary space before PHP closing tag

* Removed unnecessary space before php closing tag

* Added missing space before PHP code closing tag

* Multilingual: correcting alternates when associated menu items are com_users items (#13152)

* Multilingual: correcting alternates when associated menu items are
com_users items

* simplification

* Update languagefilter.php

oops

* [Unit Test improvements] Use getMockBuilder rather than getMock directly  (#12990)

* Use getMockBuilder rather than getMock directly

Avoid situations that would cause `PHP Fatal error:  Call to protected method PHPUnit_Framework_TestCase::getMock()` on newer versions of phpunit

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use the correct $this object

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Set up a more mock JTableExtension with getMockBuilder

* Use getMockBuilder rather than getMock directly

* Use the correct $this object

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* remove the method after replacing

* Use getMockBuilder rather than getMock directly

* More getMockBuilder in place of getMock

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Fix testParse mock Constructor Args

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* disableOriginalConstructor

* disableOriginalConstructor()

* disableOriginalConstructor()

* disableOriginalConstructor()

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* another spot for getMockBuilder

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* remove duplicate $this->transport

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Use getMockBuilder rather than getMock directly

* Add 'setUserState' to MockApplicationCms

Fixes 2 warnings on phpUnit 5.6:
1) JModelListTest::testGetuserstateUsesDefault
Trying to configure method "setUserState" which cannot be configured because it does not exist, has not been specified, is final, or is static
2) JModelListTest::testGetuserstateUsesRequestData
Trying to configure method "setUserState" which cannot be configured because it does not exist, has not been specified, is final, or is static

* mockDatabase fails for mockTableExtension on hhvm

Fixes 10 hhvm failures that have one of the following messages
```php
UnexpectedValueException: No columns found for #__extensions table

Expectation failed for method name is equal to <string:parseSchemaUpdates> when invoked 1 time(s).
Method was expected to be called 1 times, actually called 0 times.
```

* cs-fix extra semicolon

* remove trailing coma

* remove trailing comma

* Coding style - PHP code tag and control structures II (#13149)

* Removed unnecessary spaces after PHP code opening tag

* Removed unnecessary spaces before PHP code closing tag

* Added a white-space before PHP code closing tag where missing

* Fixed style for control structures alternative syntax

* Remove never needed nor used JED Update Server from new installs (#13047)

* Update joomla.sql

* Update joomla.sql

* Update joomla.sql

* Update joomla.sql

* Update joomla.xml

* Update jos_update_sites.csv

* Update jos_update_sites_extensions.csv

* Update script.php

* Update script.php

* Update joomla.sql

* Update script.php

* [PHP 7.1] Adapt JDate to reflect that php now sets DateTime() with microseconds (#13079)

* Update date.php

* Update date.php

* Update date.php

* Replacements for deprecated JFile::read() (#13160)

* Replacements for deprecated JFile::read()

* Removed replacements for FOF

* Type-safe comparison for isClient (#13157)

* Set correct default values for user creation in the backend also in the sample_learn.sql sample data (#13127)

The default value for the useractivation param is 2
https://github.com/joomla/joomla-cms/blob/3.6.4/administrator/components/com_users/config.xml#L45-L68

* Set correct default values for user creation in the backend also in the sample_learn.sql sample data (#13127)

The default value for the useractivation param is 2
https://github.com/joomla/joomla-cms/blob/3.6.4/administrator/components/com_users/config.xml#L45-L68

* Removed some unnecessary strtotime() calls (#13171)

* Fix unittest on cache - 5 seconds less (#11872)

* Run test at JCacheTest->testGc with not empty storage and caching enabled.

* Test if cache file after run gc does not exists.

* Fixed misuses of array_push() project wide (#12170)

* Replaced rand() with mt_rand() projectwide

* Fixed misuses of array_push()

* Fixed PHPMailer problems

* Reverted some changes, as they are in included external frameworks

* Removed changes which were irrelevant to this PR.

* Changed some recently added array_push calls

* Fixed accidental deletion of curly bracket

* revert e91177d

* Smart search parser leaking CSS and JS terms (#12411)

* Strip head first because of possible nested tags

* Remove chunking from indexer

* Responsive site title for protostar (#13064)

* Responsive site title for protostar

* Updated less file too

* Fixed less compling, added maximum of 40px for font-size

* Better scaling factor, removed calc on line-height it is not really needed and causes a little jumping

* Improve menu associations (#13086)

* Unittest fix - do not use PDO driver directly (#13097)

* Use database driver in the right way in unittests

* Fix unittests

* Allow packages to declare that their child extensions cannot be uninstalled (#13154)

* Allow packages to declare that their child extensions cannot be uninstalled

* Change tag name, fix bugged instanatiation of manifest class, add tag to English package manifest

* Remove language check

* Flag in JInstaller that a package is being uninstalled to allow its children to be removed

* Speed up hhvm unit tests - disable jit (#13169)

* Wrong color on active menu item in mobile view - Protostar (#12303)

* Update template.less

Fix css issue with menu active item in mobile screens

* Update template.css

CSS Fix for active menu item in mobile screens

* [com_fields] Include group state only when not on back end list (#12696)

* Include group state only when not on back end list

* Add comment

* Update default_permissions.php

* Remove senseless proxy functions

* Updating calendar locales

* Replacements for deprecated getCfg() (#13161)

* Replacements for deprecated getCfg()

* Replacements for deprecated AbstractRegistryFormat Class implementations

* Don't load authorised view levels in foreach for tags generation (#13140)

* Don't load authorised groups in foreach for tags generation

* Add $

* Use user method

* Change variable name

* Replacements for deprecated JApplication::getHash() (#13162)

* Replacements for deprecated JApplication::getHash()

* Replacements for deprecated JApplication::getHash()

* Replacements for deprecated JApplication::getHash()

* Coding style - PHP code tag and control structures III (#13173)

* Removed unnecessary spaces after PHP code opening tag

* Added a white-space before PHP code closing tag where missing

* Removed unnecessary spaces before PHP code closing tag

* Fixed style for control structures alternative syntax

* Fixed style for control structures alternative syntax

* Added a semicolon at the end of statement where missing

* Coding style - PHP code tag and control structures IV (#13176)

* Removed unnecessary spaces after PHP code opening tag

* Removed unnecessary spaces before PHP code closing tag

* Added a white-space before PHP code closing tag where missing

* Removed unnecessary spaces before PHP code closing tag

* Added a white-space before PHP code closing tag where missing

* Added a white-space before PHP code closing tag where missing

* Added a semicolon at the end of statement where missing

* Fixed style for control structures alternative syntax

* Copy and new should use the group_id (#13179)

* Unnecessary double quotes in site components (#13183)

* Replace unnecessary double quotes in site/components

* small correction

* Included a fix for an existing bug that @andrepereiradasilva pointed out

* Merged unset calls (#13186)

* Remove one-time-use variables (#13187)

* Remove unnecessary parentheses in site components (#13190)

* Remove unnecessary parentheses in site/components

* Insert space, wrongfully removed

* Re-added a pair, for readability as @andrepereiradasilva suggested not to have it ungrouped for readability

* Removed some whitespace, as noted in @shur's comment

* Use short syntax for applied operations (#13188)

* New Feature: add redirect option after article submission

* Remove DPFields leftover (#13229)

* [com_fields] Migrate from repeatable to subform field for list options (#13069)

* Migrate from repeatable to subform field for list options

* Adapt checkboxes and radio

* Merge regression

* Simplify ternary with elvis in site component (#13185)

* Simplify ternary with elvis operator

* Fixed indentation

* Forgot to remove these parentheses in merge from staging

* Removed silly assignments (#13196)

* Replace unnecessary double quotes (#13239)

* Replace unnecessary double quotes in libraries/cms (#13235)

* Replace unnecessary double quotes

* Reverted some double quotes-replacements

* Various changes in modules (#13216)

* Simplify ternary operation with elvis operator

* Remove unnecessary parentheses

* Remove redundant variables

* Code formatting

* Add cursor:pointer; for making dismiss alert work on ios devices (#11965)

* Simplify ternary operation using elvis operator

* Remove unneeded parentheses

* Media Manager Restyle (#12643)

* Media manager restyle - Initial commit

* Media Manager restyle

* Delete option added on image hover

* Center thumbnail X icon

* Media restyle added to xtd-button

* JS moved popup-imagemanager.js

* JS added to popup-imagemanager.min.js

* CS

* Revert iframe height increase

* Modal margin

* RTL support

* RTL - correcting image popup display

* cs fix travis built (#13255)

* Deleting unused lang strings (com_fields) (#13259)

* Deleting unused language string

* another

* Cleanups, fixes and a bit of optimizations for site/components batch #3 (#12292)

* Cleanups, fixes and a bit of optimizations for site/components batch #3

- com_content

Note: This is a single commit bundling all types of changes, since PR #12261 which had detailed commits, was rejected as a whole

* Ch-Ch-Ch-Changes!

Made some changes as pointed out by @andrepereiradasilva

* A bit more...

* Revert

* Removed empty function, as there is a fallback. Change made according to comment from @wilsonge

* Included @andrepereiradasilva's suggestions

* Inserting whitespace before php closing tag

* Replace unnecessary double quotes in templates (#13245)

* Replace unnecessary double quotes

* Revert overzealous replacements

* Formatting fix

* Replace unnecessary double quotes (#13215)

* Cleanups, fixes and a bit of optimizations for site/components batch #1 (#12290)

* Cleanups, fixes and a bit of optimizations for site/components batch #1

- com_ajax
- com_banners
- com_config
Note: This is a single commit bundling all types of changes, since PR #12261 which had detailed commits, was rejected as a whole

* Ch-Ch-Changes!

* Removed the query changes

* Fix for wrong merge resolve

* Replaced unnecessary double quotes in plugins (#13211)

* Replaced unnecessary double quotes in plugins

* spaces

* Revert change to 3rd party file.

* Removed unnecessary parentheses in plugins (#13212)

* Various changes in plugins (#13213)

* Remove one-time use variable

* Merge unset calls

* Remove obvious variants from ternary operation

* Use short syntax for applied operation

* Performance 5 (modules) (#12229)

* Use Elvis instead of full ternary

* Included nested positive if in parent

* Double quotes to single quotes

* Removed unnecessary parentheses

* Inline one-time use variables

* Type-safe string comparisons

* More type safe comparisons

* Replace is_null() with === null

* Replace strstr with strpos

* Replace substr with strpos

* Optimize non-optimal if conditions.

* Merged cascading str_replace calls

* Another type safe-comparison

* Fix multiple calls to callable in if condition

* Flip some conditions back after removing the condition call

* Fix codesniffer

* Fix codesniffer...

* This one is probably better left loose typed

* ... and this one, too.

* Use Elvis instead of full ternary

* Included nested positive if in parent

* Double quotes to single quotes

* Removed unnecessary parentheses

* Inline one-time use variables

* Type-safe string comparisons

* More type safe comparisons

* Replace is_null() with === null

* Replace strstr with strpos

* Replace substr with strpos

* Optimize non-optimal if conditions.

* Merged cascading str_replace calls

* Another type safe-comparison

* Fix multiple calls to callable in if condition

* Flip some conditions back after removing the condition call

* Fix codesniffer

* Fix codesniffer...

* This one is probably better left loose typed

* ... and this one, too.

* A few more changes based on discussion with @andrepereiradasilva

* Drop index idx_image in #__languages table (#13252)

* Update joomla.sql

* Update joomla.sql

* Update joomla.sql

* Update 3.7.0-2016-11-21.sql

* Update 3.7.0-2016-11-21.sql

* Update 3.7.0-2016-11-21.sql

* HTML5 pattern in validate.js (#13094)

* html5 pattern

* implement @ralain 's suggestion

Thank you @ralain

* Fixes for errors introduced with conflict resolution

* Fixes for errors introduced with conflict resolution

* Update head.php (#13081)

* [com_fields] Change extension variable to context for custom field groups (#13175)

* Change extension variable to context for custom field groups

* Stabilizing javascript

* Fixing code style error

* Check for admin permission of com_fields access correct

* Don't process value adjusting twice (#13233)

* Modals style cleanup (#13261)

* Variable names - naming conventions - testing the waters (#13170)

* Various changes in libraries legacy (#13241)

* Inline one-time use variables

* Removed unnecessary ternary operators

* Merge unset() calls

* Use modern day type-casting

* This can be replaced with type-casting

* Changes on continue statements (#13199)

* Remove unnecessary 'continue' function

* Change 'continue' so that it breaks out of the 'switch', as there is no need to compare against the rest.

* Fixed mistake

* Added a break in `separator` case, as there is nothing to execute under `heading`,  in that case.

* Revert changes in 3rd party file

* Fix vertical scroll (#13269)

* Type safe string comparison of strings in plugins

* Remove false param on fetching form data (#13254)

* Remove unneeded registry creation (#12571)

* Contact params already are Registry objects.

* Newsfeed params already are Registry objects.

* Menu params already are Registry objects.

* Fixing wrong merging

* Lazy session starting (#13074)

* Allow lazy starting a session

* Defer starting sessions in the installer

* Defer starting session in JApplicationCms

* Unit test fixes

* [com_fields] Normalise data structure for assigned categories (#13246)

* Normalise #__fields -> assigned_cat_ids

* Fixing typo in table name

* Fixed issue #11932

Removed an unnecessary range restriction on a SQL query, which caused an
invalid query to be generated for Microsoft SQL Server.

* fix CS after 3.6.5 ..

* Fix accidentally flipped comparison

* Replace unnecessary double quotes

* some more double quote replacements

* This one, too...

* Add context selector to fields groups

* Composer install

* Type-safe string comparison in site/templates

* prepare alpha1 release

* [com_fields] Migrate user groups from categories to field groups (#13103)

* Migrate user groups from categories to field groups

* Renamed variable from category to group

* Show only fields which are in selected groups

* Change identifier from extension to context

* [com_fields] - Creating a New field give SQL error on postgresql (#13155)

* [com_fields] - Creating a New field give SQL error on postgresql

Postgres: Inserting an image field fails with an error #13137

* xml default

xml default

* added JNONE

added JNONE

* Template menu assign fix n styling (#13280)

* Improve doc blocks for JMenu (#13274)

* Moved JPluginHelper::importPlugin() call outside loops. (#13248)

* Logout code needs to account for shared_session parameter (#13273)

* Fix subform chosen (#12993)

* Initialize chosen when adding rows in repeatable subforms

* Use JHtml::script and JHtml::stylesheet in the new way

* Subform does not need to fix chosen.

* Codemirror fluid height (#13266)

* Codemirror fluid height

* Min-height changed to 400px

* Moved less to _editors.less - added max-height

* Delete assigned categories when field is deleted (#13315)

* Remove unused local variables project wide (#13206)

* Remove unused or immediately overwritten variables

* Remove unused or immediately overwritten variables in tests

* Commented out some reference code, as it is not used in that scope

* Not sure on this removal. Added a TODO.

* Fixed accidentally removed $

* Fix codesniffer

* Revert changes in this file, as it is an external library

* Update field.php
fb3e6ba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment