[BUG]: Issue with SFTP server and Compiling to Sales server #1252

Closed
opened 2025-09-15 15:20:43 +00:00 by SimonvanDoorne · 1 comment
Member

What Happened?

I selected 'Add sales server' to a component and i got the error after compiling: "Upload of component (Moduletester) zip file failed.". After some digging i found that this file has some unexcpeted behaviour
c53260c6c7/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Server/Model/Load.php (L75-L81)

When JCB is attempting to check the field values from #__componentbuilder_server, there seems to be a bug. Here are the parameters used and dumped
afbeelding.png

The check $this->table->get($table,$field,'store') seems to always return basic_encryption for the fields that are marked 'encrypted field' in the server admin view, even though the raw value is sent to this function

  • username
  • host
  • port
  • path

I hope i made myself clear, in short it seems that the function 'value' in Load.php is expecting a encoded value, while the raw value is sent.

Steps to reproduce the Bug

  1. Create an SFTP 'Server' in JCB
  2. Set all fields
  3. Compile and expect export to SFTP Server

Which Joomla version are you compiling in?

5.3.3

Which PHP version are you compiling in?

8.3

Which Joomla versions are you targeting?

5.3.3

Which PHP version are you targeting?

8.3

Which Web server is JCB running on?

Ubuntu

Which Relational Database is JCB running on?

MariaDB

Which OS is JCB running on?

CentOs

Which JCB version are you using?

5.1.2-beta2

Where in JCB did this issue occur?

Compilation of a component, Servers(admin_views)

On which browsers did you encounter the issue?

Firefox

Additional Comments

No response

### What Happened? I selected 'Add sales server' to a component and i got the error after compiling: "Upload of component (Moduletester) zip file failed.". After some digging i found that this file has some unexcpeted behaviour https://git.vdm.dev/joomla/Component-Builder/src/commit/c53260c6c7097334d896aec7c0ebfcd3dbda9b41/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Server/Model/Load.php#L75-L81 When JCB is attempting to check the field values from #__componentbuilder_server, there seems to be a bug. Here are the parameters used and dumped ![afbeelding.png](/attachments/34817b05-9bea-426b-bd7b-204e3d28a7f4) The check `$this->table->get($table,$field,'store')` seems to always return basic_encryption for the fields that are marked 'encrypted field' in the server admin view, even though the raw value is sent to this function - username - host - port - path I hope i made myself clear, in short it seems that the function 'value' in Load.php is expecting a encoded value, while the raw value is sent. ### Steps to reproduce the Bug 1) Create an SFTP 'Server' in JCB 2) Set all fields 3) Compile and expect export to SFTP Server ### Which Joomla version are you compiling in? 5.3.3 ### Which PHP version are you compiling in? 8.3 ### Which Joomla versions are you targeting? 5.3.3 ### Which PHP version are you targeting? 8.3 ### Which Web server is JCB running on? Ubuntu ### Which Relational Database is JCB running on? MariaDB ### Which OS is JCB running on? CentOs ### Which JCB version are you using? 5.1.2-beta2 ### Where in JCB did this issue occur? Compilation of a component, Servers(admin_views) ### On which browsers did you encounter the issue? Firefox ### Additional Comments _No response_
SimonvanDoorne added the Bug label 2025-09-15 15:20:43 +00:00
SimonvanDoorne changed title from [BUG]: Issue with setting SFTP server and Compiling to Sales server to [BUG]: Issue with SFTP server and Compiling to Sales server 2025-09-15 15:20:59 +00:00
Author
Member

Update: I found in the server model save function these checks
c53260c6c7/admin/src/Model/ServerModel.php (L164-L166)
and
c53260c6c7/admin/src/Model/ServerModel.php (L198-L207)
It seems that while saving the server, it only encrypts the data if there is an encryption key set. While the function in the load.php expects it to always be encoded. If this is intend behaviour, fair enough, but it would be nice for a little notification while saving a server that encrypted_field means you need te have a encrypted key set for these fields to work

Update: I found in the server model save function these checks https://git.vdm.dev/joomla/Component-Builder/src/commit/c53260c6c7097334d896aec7c0ebfcd3dbda9b41/admin/src/Model/ServerModel.php#L164-L166 and https://git.vdm.dev/joomla/Component-Builder/src/commit/c53260c6c7097334d896aec7c0ebfcd3dbda9b41/admin/src/Model/ServerModel.php#L198-L207 It seems that while saving the server, it only encrypts the data if there is an encryption key set. While the function in the load.php expects it to **always** be encoded. If this is intend behaviour, fair enough, but it would be nice for a little notification while saving a server that *encrypted_field* means you **need** te have a encrypted key set for these fields to work
Robot referenced this issue from a commit 2025-09-19 14:41:44 +00:00
Robot referenced this issue from a commit 2025-09-19 14:55:03 +00:00
Robot referenced this issue from a commit 2025-09-19 15:03:26 +00:00
Robot referenced this issue from a commit 2025-10-15 20:35:52 +00:00
Robot referenced this issue from a commit 2025-10-15 20:57:03 +00:00
Robot referenced this issue from a commit 2025-10-15 21:07:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1252