using getCustom in dynamic get removes model and template files #773

Closed
opened 2021-07-05 20:46:36 +00:00 by dformdotdk · 2 comments
dformdotdk commented 2021-07-05 20:46:36 +00:00 (Migrated from github.com)

Not sure if this is a bug or not, or just the getCustom in dynamic get that is not fully implemented, or perhaps more likely - my lack of understanding how JCB works.

Steps to reproduce the issue

Please take a look at this video, where I demonstrate my findings: https://youtu.be/MIFwehTutPA

Expected result

Model and template to remain, but model with only my own code in the model function

Actual result

Model and template is missing

System information (as much as possible)

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

Additional comments

JCB is awesome :-)

Not sure if this is a bug or not, or just the getCustom in dynamic get that is not fully implemented, or perhaps more likely - my lack of understanding how JCB works. ### Steps to reproduce the issue Please take a look at this video, where I demonstrate my findings: https://youtu.be/MIFwehTutPA ### Expected result Model and template to remain, but model with only my own code in the model function ### Actual result Model and template is missing ### System information (as much as possible) - OS Name & Version: - MySql Version: - Apache Version: - PHP Version: 7.4 - Joomla Version: 3.9.27 - JCB Version: 2.12.10 - Browser: ### Additional comments JCB is awesome :-)

Make sure that your site-view, or custom-admin-view does not have the same name as any other admin-view. This will be the first thing to look at, then secondly after watching your recording I can understand the issue.

This is not a bug, but your are breaking the main get behavior.

When you open the site-view or custom-admin-view you will see the main get is mandatory, you will also see that only getItems and getItem types are listed in the main get. When you want to add custom gets there is another field for it, that is not mandatory, and you can select multiple custom gets, but just one main get.

So when you change the get type in the dynamic get you remove the main get from the site view. JCB detects that and does not build the needed files as it does not find a main get. Custom gets can not be used as main gets... that is really all. There is also just to much various relationships for us to track... that JCB does not stop you from changing the type. But when you open the site view you will see there is no main get selected and if you try to save it will stop you as the main get is mandatory.

I know the current model is not living up to all the various use cases, I also know you can write a generic "getItem" that just return true as a custom code. Which you can add as the main get... then add as many custom gets as you like. This is the current workaround. Somewhere in the future we will improve this area... then you will have more freedom. But for now that will be your best choice.

Make sure that your site-view, or custom-admin-view does not have the same name as any other admin-view. This will be the first thing to look at, then secondly after watching your recording I can understand the issue. This is not a bug, but your are breaking the main get behavior. When you open the site-view or custom-admin-view you will see the main get is **mandatory**, you will also see that only **getItems** and **getItem** types are listed in the **main get**. When you want to add custom gets there is another field for it, that is **not mandatory**, and you can select **multiple** custom gets, but just **one** main get. So when you change the get type in the dynamic get you remove the main get from the site view. JCB detects that and does not build the needed files as it does not find a main get. Custom gets can not be used as main gets... that is really all. There is also just to much various relationships for us to track... that JCB does not stop you from changing the type. But when you open the site view you will see there is no main get selected and if you try to save it will stop you as the main get is mandatory. I know the current model is not living up to all the various use cases, I also know you can write a generic "getItem" that just return true as a custom code. Which you can add as the main get... then add as many custom gets as you like. This is the current workaround. Somewhere in the future we will improve this area... then you will have more freedom. But for now that will be your best choice.

Let me know if you have any further question on this issue.

Let me know if you have any further question on this issue.
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#773
No description provided.