Bug #5340
closed
- Priority changed from Normal to Urgent
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.
- 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.
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.
Probably best for this to fix in our system plugin acting on the afterRoute. We'd just basically reset the Input variables.
- 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.
- Status changed from Resolved to Closed
Also available in: Atom
PDF