Custom Code problem 'loop' #878

Closed
opened 2022-03-25 17:12:03 +00:00 by cpaschen · 1 comment
cpaschen commented 2022-03-25 17:12:03 +00:00 (Migrated from github.com)

Steps to reproduce the issue

  • Add a 'replace' custom code (via IDE) into a layout file.
  • Then stop using that layout (by not having anything assigned to that tab/area in the admin view field list), so the layout file is no longer used in the component
  • Compile the component

Expected result

JCB shouldn't try to process Replace/Insert codes in files that are no longer used in the component

Actual result

Error notice after compile:

File site/layouts//<tab_name>_fullwidth.php could not be found, so the custom code for this file could not be addded.

System information (as much as possible)

  • OS Name & Version: WAMP
  • MySql Version: mysql 5.7.31
  • Apache Version: 2.4.46
  • PHP Version: 7.4.9
  • Joomla Version: 3.10.6
  • JCB Version: 2.12.15
  • Browser: Firefox Developer (nightly build)

Additional comments

Even if you disable the entry that is created in the Custom Codes area, it then tries to create a new custom code entry and then can't process it because the file is not in the active component.

This is a pretty low-level/priority issue, but could be somewhat confusing to new users of JCB. Would be nice if it just wouldn't even look for custom codes in files that are not active in the component. Although I'm not sure how much of an issue that would be to add to the workflow.

### Steps to reproduce the issue * Add a 'replace' custom code (via IDE) into a layout file. * Then stop using that layout (by not having anything assigned to that tab/area in the admin view field list), so the layout file is no longer used in the component * Compile the component ### Expected result JCB shouldn't try to process Replace/Insert codes in files that are no longer used in the component ### Actual result Error notice after compile: File site/layouts/<view>/<tab_name>_fullwidth.php could not be found, so the custom code for this file could not be addded. ### System information (as much as possible) - OS Name & Version: WAMP - MySql Version: mysql 5.7.31 - Apache Version: 2.4.46 - PHP Version: 7.4.9 - Joomla Version: 3.10.6 - JCB Version: 2.12.15 - Browser: Firefox Developer (nightly build) ### Additional comments Even if you disable the entry that is created in the Custom Codes area, it then tries to create a new custom code entry and then can't process it because the file is not in the active component. This is a pretty low-level/priority issue, but could be somewhat confusing to new users of JCB. Would be nice if it just wouldn't even look for custom codes in files that are not active in the component. Although I'm not sure how much of an issue that would be to add to the workflow.

This is a problem since we don't search your installed component based on the new files, we search all php,xml,js files in your component folders.

So there is really just to two options here, delete the file from your website, or don't add tags to the file.

To change this search method will require either auto delete of files no longer active, or worse. So don't think we will be going that direction anytime soon... hope you can live with that.

This is a problem since we don't search your installed component based on the new files, we [search all](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/admin/helpers/compiler/a_Get.php#L10961) `php,xml,js` files in your [component folders](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/admin/helpers/compiler/a_Get.php#L12115). So there is really just to two options here, **delete** the file from your website, or **don't add tags** to the file. To change this search method will require either auto delete of files no longer active, or worse. So don't think we will be going that direction anytime soon... hope you can live with that.
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#878
No description provided.