Missplaced Generated Comment when using Custom Import #603

Closed
opened 2020-09-23 09:49:00 +00:00 by marcorensch · 1 comment
marcorensch commented 2020-09-23 09:49:00 +00:00 (Migrated from github.com)

Steps to reproduce the issue

Activate Custom Import for a table
affected file: administrator/components/com_component/views/import_VIEW/tmpl/default.php

Expected result

You got custom import

Actual result

You have custom import BUT
it places a Comment into the code:
/***[JCBGUI.admin_view.html_import_view.116.$$$$]***/
As a result this comment will be displayed in the import dialog.
The Comment is missplaced and should be before line 29 where the PHP Tag is closed.

Code Snipped (Line 26 -> 31):

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('jquery.framework');
JHtml::_('bootstrap.tooltip');
JHtml::_('script', 'system/core.js', false, true);
JHtml::_('behavior.keepalive');
?>

/***[JCBGUI.admin_view.html_import_view.116.$$$$]***/
<script type="text/javascript">

System information (as much as possible)

  • OS Name & Version:
  • MySql Version:
  • Apache Version:
  • PHP Version:
  • Joomla Version:
  • JCB Version:
  • Browser:

Additional comments

### Steps to reproduce the issue Activate Custom Import for a table affected file: administrator/components/com_component/views/import_VIEW/tmpl/default.php ### Expected result You got custom import ### Actual result You have custom import BUT it places a Comment into the code: `/***[JCBGUI.admin_view.html_import_view.116.$$$$]***/` As a result this comment will be displayed in the import dialog. The Comment is missplaced and should be before line 29 where the PHP Tag is closed. Code Snipped (Line 26 -> 31): ``` // No direct access to this file defined('_JEXEC') or die('Restricted access'); JHtml::_('jquery.framework'); JHtml::_('bootstrap.tooltip'); JHtml::_('script', 'system/core.js', false, true); JHtml::_('behavior.keepalive'); ?> /***[JCBGUI.admin_view.html_import_view.116.$$$$]***/ <script type="text/javascript"> ``` ### System information (as much as possible) - OS Name & Version: - MySql Version: - Apache Version: - PHP Version: - Joomla Version: - JCB Version: - Browser: ### Additional comments

Okay it seems like the placeholder is in the right place, but with the wrong commenting style. This html_import_view is an HTML area , and should have an HTML commenting style.

image

So I need to change this code to make sure the placeholder is HTML instead.

So change this code from:

$guiMapper['field'] = $importScripter;

to the following:

// update GUI mapper field
$guiMapper['field'] = $importScripter;
$guiMapper['type'] = 'php';
// Make sure html gets HTML comment for placeholder
if ('html_import_view' === $importScripter)
{
	$guiMapper['type'] = 'html';
}
else
{
	$guiMapper['type'] = 'php';
}

Thanks for the heads up, I missed this one!

Okay it seems like the placeholder is in the right place, but with the wrong commenting style. This `html_import_view` is an HTML area , and should have an HTML commenting style. ![image](https://user-images.githubusercontent.com/5607939/95267286-2b704900-0835-11eb-9e2d-08e78fb04ee5.png) So I need to change [this code](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/admin/helpers/compiler/a_Get.php#L3028) to make sure the placeholder is HTML instead. So change this code from: ```php $guiMapper['field'] = $importScripter; ``` to the following: ```php // update GUI mapper field $guiMapper['field'] = $importScripter; $guiMapper['type'] = 'php'; // Make sure html gets HTML comment for placeholder if ('html_import_view' === $importScripter) { $guiMapper['type'] = 'html'; } else { $guiMapper['type'] = 'php'; } ``` Thanks for the heads up, I missed this one!
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#603
No description provided.