bug in fields scripts #609

Closed
opened 2020-10-21 11:07:19 +00:00 by saman222 · 4 comments
saman222 commented 2020-10-21 11:07:19 +00:00 (Migrated from github.com)

Steps to reproduce the issue

hi
When add js script (whatever in view or views) and assign that field to an admin view, it works correctly
but when assign that field to module fields params no js will be triggered!

System information (as much as possible)

  • OS Name & Version:
  • MySql Version: 10.3.25-MariaDB
  • Apache Version: 2.4.46
  • PHP Version: 7.4.11
  • Joomla Version: 3.9.14 Stable
  • JCB Version: 2.11.4
  • Browser: Chrome Version 86.0.4240.75 (Official Build) (64-bit)

Additional comments

### Steps to reproduce the issue hi When add js script (whatever in view or views) and assign that field to an admin view, it works correctly but when assign that field to module fields params no js will be triggered! ### System information (as much as possible) - OS Name & Version: - MySql Version: 10.3.25-MariaDB - Apache Version: 2.4.46 - PHP Version: 7.4.11 - Joomla Version: 3.9.14 Stable - JCB Version: 2.11.4 - Browser: Chrome Version 86.0.4240.75 (Official Build) (64-bit) ### Additional comments

Yes, you are indeed right, I have not finished this part, but everything is there for it to work. So I spend a few minutes to see the path needed to add, and have added it. Please test the staging branch when you get a moment... and let me know.

(THIS WAS CHANGE READ THE WHOLE THREAD)
Just a note, with modules you can only use the view and view-footer meaning these:

CSS

image

JS

image

Yes, you are indeed right, I have not finished this part, but everything is there for it to work. So I spend a few minutes to see the path needed to add, and have added it. Please test the staging branch when you get a moment... and let me know. (THIS WAS CHANGE READ THE WHOLE THREAD) Just a note, with modules you can only use the `view` and `view-footer` meaning these: > CSS ![image](https://user-images.githubusercontent.com/5607939/98325501-a5901b00-1ff7-11eb-8493-aedf63072566.png) > JS ![image](https://user-images.githubusercontent.com/5607939/98325480-98732c00-1ff7-11eb-8613-05a2758732f9.png)

Okay I found a contradiction in the current implementation, I pushed yesterday. I think we need to change it, so the the view and view-footer gets added the the module admin area, and the views and views-footer gets added to the module display area.

Okay I found a contradiction in the current implementation, I pushed yesterday. I think we need to change it, so the the `view` and `view-footer` gets added the the module admin area, and the `views` and `views-footer` gets added to the module display area.

Okay at this point it seem like it will take a bit more code, automated code...

I will see if I get time to get this done. But we are faced with some serious challenge here, since we can not directly add JS and CSS to the module admin area, and have to instead create a custom field, which must get the code in the class. Hmmm this will be tricky at a high level. Since we have a number of other conflicts, like not all fields are custom, and not all fields gets added to the module, but gets added via the component. In which case we could face massive collisions.

I will continue looking, there is one more option worth looking into, and that is to create a custom field (this is done automatically, not by you) that JCB use to just added the scripts, and do nothing else... so we combine all the scripts of all fields into this one blank field... just to load the scripts. This seems like a good work around.

Okay at this point it seem like it will take a bit more code, [automated code](https://joomla.stackexchange.com/a/24058/2166)... I will see if I get time to get this done. But we are faced with some serious challenge here, since we can not directly add JS and CSS to the module admin area, and have to instead create a custom field, which must get the code in the class. Hmmm this will be tricky at a high level. Since we have a number of other conflicts, like not all fields are custom, and not all fields gets added to the module, but gets added via the component. In which case we could face massive collisions. I will continue looking, there is one more option worth looking into, and that is to create a custom field (this is done automatically, not by you) that JCB use to just added the scripts, and do nothing else... so we combine all the scripts of all fields into this one blank field... just to load the scripts. This seems like a good work around.

@saman222, please test and let me know.

This is how it should work when you now add a field to a module.

  • Add CSS (view) => CSS => will be added to the ADMIN area (where you set the module details)
  • Add JavaScript (view-footer) => Javascript (edit view footer) => will be added to the ADMIN area (where you set the module details)
  • Add CSS (views) => CSS => will be added to the DISPLAY area (where to module is displayed)
  • Add JavaScript (views-footer) => Javascript (list view footer) => will be added to the DISPLAY area (where to module is displayed)
@saman222, please test and let me know. ### This is how it should work when you now add a field to a module. - Add CSS (view) => CSS => will be added to the ADMIN area (where you set the module details) - Add JavaScript (view-footer) => Javascript (edit view footer) => will be added to the ADMIN area (where you set the module details) - Add CSS (views) => CSS => will be added to the DISPLAY area (where to module is displayed) - Add JavaScript (views-footer) => Javascript (list view footer) => will be added to the DISPLAY area (where to module is displayed)
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#609
No description provided.