Unexpected output: Affected paths: no mapping - resubmit patch.
⚙ D97 INP-1448 Allow to set pass_through value in adm:SelectorLink tag as parameter
Page MenuHomeIn-Portal Phabricator

INP-1448 Allow to set pass_through value in adm:SelectorLink tag as parameter
ClosedPublic

Authored by glebs on Jul 29 2015, 6:51 AM.

Details

Test Plan
  1. change definition of inp_edit_category element in /core/admin_templates/incs/form_blocks.tpl file by adding pass_through='test' test='testvalue' to call of adm_SelectorLink tag
  2. go to Website & ContentStructure & Data and open some category for editing
  3. open browser developer tools to see HTTP queries
  4. click on the icon of Point to Section field
  5. navigate into some category and back
  6. confirm, that test=testvalue exists in ajax request urls

Diff Detail

Repository
rINP In-Portal
Branch
/w/in-portal.full/branches/5.3.x
Lint
Lint OK
Unit
No Unit Test Coverage

Event Timeline

glebs updated this revision to Diff 231.Jul 29 2015, 6:51 AM
glebs retitled this revision from to INP-1448 Allow to set pass_through value in adm:SelectorLink tag as parameter.
glebs updated this object.
glebs edited the test plan for this revision. (Show Details)
glebs added 1 JIRA issue(s): INP-1448.
alex requested changes to this revision.Jul 29 2015, 7:44 AM
alex edited the test plan for this revision. (Show Details)
alex edited edge metadata.
alex edited edge metadata.

Please create revision from In-Portal 5.3.x instead of 5.2.x. You can just submit update of that revision from In-Portal 5.3 instead adding new differential revision.

This revision now requires changes to proceed.Jul 29 2015, 7:45 AM
glebs updated this revision to Diff 232.Jul 29 2015, 7:50 AM
glebs edited edge metadata.

Updated patch for In-Portal 5.3

alex requested changes to this revision.Jul 29 2015, 8:16 AM
alex edited edge metadata.

The test parameter is present in URLs to AJAX requests (e.g. to catalog_tab template), but it's absent in pass_through, which always has type value (e.g. admin/index.php?env=-catalog_tab%3Am-1--1--s-4&pass_through=type&test=testvalue&tm=single&tp=none&type=item_selector&ajax=yes).

Need to find out how it's possible that:

  • test parameter is being passed in all requests, while not being listed in pass_through
  • some magical pass_through=type appears from nowhere
This revision now requires changes to proceed.Jul 29 2015, 8:16 AM
glebs updated this revision to Diff 236.Jul 29 2015, 11:43 AM
glebs edited edge metadata.

Update SelectorLink and it's usage

glebs updated this revision to Diff 237.Jul 29 2015, 11:49 AM
glebs edited edge metadata.

Remove unneded change

alex requested changes to this revision.Jul 29 2015, 12:06 PM
alex edited edge metadata.
alex added inline comments.
core/units/admin/admin_tag_processor.php
468–479

Please use construct like in <inp2:m_T tag for getting passed template:

$template = $this->SelectParam($params, 't,template');

Then check that $template variable inside IF.

472

Please don't change comment placement to keep consistent comment placement across the tag.

501

Replace with following code to avoid usage of empty values:

if ( isset($params['prefix']) && $params['prefix'] ) {
508

Replace with following code to avoid usage of empty values:

if ( isset($params['pass_through']) && $params['pass_through'] ) {
523

Inline this, because $pass_through variable isn't used anywhere past this point.

This revision now requires changes to proceed.Jul 29 2015, 12:06 PM
glebs added inline comments.Jul 30 2015, 2:08 AM
core/units/admin/admin_tag_processor.php
472

It raises lint error. I can't leave it in old place

glebs updated this revision to Diff 238.Jul 30 2015, 2:52 AM
glebs edited edge metadata.

Fixes according to notes

alex requested changes to this revision.Jul 30 2015, 3:21 AM
alex edited edge metadata.
alex added inline comments.
core/units/admin/admin_tag_processor.php
482–497

Add following check around this line:

if ( !isset($params['m_cat_id') ) {

to avoid user given m_cat_id parameter from being overwritten (like in case with core/admin_templates/catalog/advanced_view.tpl template).

This revision now requires changes to proceed.Jul 30 2015, 3:21 AM
glebs updated this revision to Diff 239.Jul 30 2015, 3:41 AM
glebs edited edge metadata.

Set m_cat_id only if it's not defined in tag params

alex requested changes to this revision.Jul 30 2015, 4:27 AM
alex edited edge metadata.
alex added inline comments.
core/admin_templates/catalog/advanced_view.tpl
41
NOTE: Update in other places, where adm_SelectorLink tag is used instead of m_Link.

Add the pass="m", when no pass parameter is given already.


The default behavior of m_Link tag, that was used previously was pass="m", but the default behavior for adm_SelectorLink is pass="all". This results in empty list of categories in category selector, when used for Points to Section field during category editing. This happens because temp mode (that is enabled, while I'm editing the category) is passed through to selector which in turn shows only categories from same temp table instead of live table.

This revision now requires changes to proceed.Jul 30 2015, 4:27 AM
glebs updated this revision to Diff 240.Jul 30 2015, 4:33 AM
glebs edited edge metadata.

Fax usage of pass attribute

alex accepted this revision.Jul 30 2015, 4:43 AM
alex edited edge metadata.
This revision is now accepted and ready to land.Jul 30 2015, 4:43 AM
This revision was automatically updated to reflect the committed changes.
alex edited edge metadata.Mar 10 2016, 5:50 AM
alex added a project: Restricted Project.