? Success

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
14 Aug 2016

Summary of Changes

To help consolidate some duplicate code and make maintenance a little easier, I propose to deprecate the JInput class chain in favor of the Framework's Input package and that the latter code be the only code used as of 4.0. Note this will require merging some patches committed here to the Framework repo but the way this PR is structured we do NOT need to do that prior to this being merged.

To help move this forward, the base JInput class now extends the Joomla\Input\Input class and uses its methods and class member vars as practical. This will allow code to typehint the namespaced class once accepted. Later pull requests can adjust the CMS' typehints for this.

If accepted, this also gives access to a new API method added in the Framework package: JInput::exists()

Testing Instructions

In all cases, the existing Platform classes (JInput*) should still be used for all interactions with the JInput API right now and filtering should continue to be done with a JFilterInput object; no changes are made that would cause it to begin using Joomla\Input\* class objects at this time. This is important because the files object specifically has additional checks that are not yet part of the Framework code (input and filter packages).

All interactions with the JInput API should continue to work exactly as they do without this patch. Data should be correctly read from the requested data source, manipulated correctly, and in the case of file uploads continue to go through the JFilterInput::isSafeFile() check when not requesting raw data.

Documentation Changes Required

At 4.0, the class name references in https://docs.joomla.org/Retrieving_request_data_using_JInput should be updated. In terms of API usage, no changes are needed; the object will continue to be accessible by JFactory::getApplication()->input.

avatar joomla-cms-bot joomla-cms-bot - change - 14 Aug 2016
Category Libraries
avatar mbabker mbabker - open - 14 Aug 2016
avatar mbabker mbabker - change - 14 Aug 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Aug 2016
Labels Added: ?
avatar photodude
photodude - comment - 18 Aug 2016

I'm guessing this needs to be rebased to get the unit test changes, since all of the unit tests are erroring in this PR.

avatar mbabker
mbabker - comment - 12 Sep 2016

Hmm. Guess I'm the only one who appreciates not having duplicate code. OK.

avatar mbabker mbabker - change - 12 Sep 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-09-12 20:57:46
Closed_By mbabker
avatar mbabker mbabker - close - 12 Sep 2016
avatar photodude
photodude - comment - 13 Sep 2016

I'm interested, just caught up with other things and haven't been able to test. duplicate code means something is going to be out of sync and will cause problems even if it's just in the maintenance side. I hate duplicate code as evidenced by my PR's dealing with other duplications.

avatar andrepereiradasilva
andrepereiradasilva - comment - 13 Sep 2016

i'm interested too

avatar zero-24
zero-24 - comment - 14 Sep 2016

@mbabker are you ok that I recreat that PR or do you want to reopen this one yourself?

Add a Comment

Login with GitHub to post a comment