Project

General

Profile

Actions

Bug #5340

closed

K2 causing view to be missing from Input

Added by krileon almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Target version:
Start date:
17 June 2015
Due date:
% Done:

100%

Estimated time:

Description

I'm not sure if this is due to K2 loading CB API too early or if K2 is just removing view. If it's due to loading API too early we need to fix why Input is breaking and not including ALL of the request data as it should The missing view is a huge problem for various plugins.

https://www.joomlapolis.com/forum/153-professional-member-support/230140-cb-conditional-validation?start=6


Related issues 1 (0 open1 closed)

Related to CB - Bug #5223: Possible CB 1.x to CB 2.x upgrade failRejectedbeat09 April 2015

Actions
Actions #1

Updated by krileon almost 9 years ago

  • Priority changed from Normal to Urgent
Actions #2

Updated by krileon almost 9 years ago

K2 is using afterInitialise to load CB API. The problem with this is if SEF is enabled the routing behavior has not been called yet. This means the SEF URL has not been converted to REQUEST variables yet. K2 needs to be using afterRoute. One way to fix maybe to use JURI and try to parse the URL for its GET variables.

Actions #3

Updated by krileon almost 9 years ago

  • Status changed from Assigned to Feedback
  • Assignee changed from krileon to beat

The below fixes it when called in comprofiler.php just below cbMapViewToTask usage (adjust the get, post, and request as needed; edited due to forge security).

Application::Input()->load( array_merge( GET, POST, REQUEST ) );
Application::Input()->getNamespaceRegistry( 'get' )->load( GET );
Application::Input()->getNamespaceRegistry( 'post' )->load( POST );

This doesn't seam like the right way to fix it though. Seams to be maybe a problem with the Input caching.

Actions #4

Updated by krileon almost 9 years ago

Steps to duplicate.

1. Install CB Nightly.
2. Install K2
3. K2 > Parameters > Advanced: Enable CB integration
4. Install CB Conditional
5. Add a condition to hide a field and mark that field required
6. Attempt to register while field is hidden

CB Conditional then fails as it doesn't know it needs to parse a registration save due to "view" being missing since K2 loaded CB before the router(), which means the URL wasn't parsed for GET/REQUEST variables when Input() was initialized.

Actions #5

Updated by krileon almost 9 years ago

Probably best for this to fix in our system plugin acting on the afterRoute. We'd just basically reset the Input variables.

Actions #6

Updated by beat almost 9 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 0 to 100

I have an alternate proposal:

There was a line in plugin.class.php that was loading the Input too early, while everything was designed for Input to be lazy-loaded late.

MR !923 fixes that unneeded line by removing it.

This keeps Input unloaded until really needed, way after Routing.

Actions #7

Updated by beat almost 9 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF