"Save" Button has "Save and New" functionality in the Admin View Item #686

Closed
opened 2021-03-05 13:08:19 +00:00 by LordRazen · 13 comments
LordRazen commented 2021-03-05 13:08:19 +00:00 (Migrated from github.com)

Steps to reproduce the issue

  • Create a component with an new Admin View

Expected result

  • If you create a new item in the Admin View, the "Save" button saves the data and return to the admin item view with the same data loaded

Actual result

  • The item is saved and you return to a new item. Basically the "Save and New" button functionality is on the "Save" button

System information (as much as possible)

  • OS Name & Version: Windows 10
  • MySql Version: MariaDB 10.4.11
  • Apache Version: Apache 2.4.43
  • PHP Version: PHP 7.4.6
  • Joomla Version: Joomla! 3.9.25 Stable
  • JCB Version: 2.12.8
  • Browser: Firefox
### Steps to reproduce the issue - Create a component with an new Admin View ### Expected result - If you create a new item in the Admin View, the "Save" button saves the data and return to the admin item view with the same data loaded ### Actual result - The item is saved and you return to a new item. Basically the "Save and New" button functionality is on the "Save" button ### System information (as much as possible) - OS Name & Version: Windows 10 - MySql Version: MariaDB 10.4.11 - Apache Version: Apache 2.4.43 - PHP Version: PHP 7.4.6 - Joomla Version: Joomla! 3.9.25 Stable - JCB Version: 2.12.8 - Browser: Firefox

Very interesting... those buttons are not managed by JCB directly... that is if I understand you correctly.

I do not get the same behavior... can you send me some screen shots? so I can visually see the issue step by step?

Very interesting... those buttons are not managed by JCB directly... that is if I understand you correctly. I do not get the same behavior... can you send me some screen shots? so I can visually see the issue step by step?
LordRazen commented 2021-03-05 17:57:25 +00:00 (Migrated from github.com)

I tested the problem with the compiled component in a clean environment and could reproduce it. I've send the component to your github@ email adress for further analysis. Thanks a lot already ^^

I tested the problem with the compiled component in a clean environment and could reproduce it. I've send the component to your github@ email adress for further analysis. Thanks a lot already ^^

hmm I would prefer to see what you are trying to do, and make sure I understand the issue before anything else. So please lets start with the screenshots that show step by step what you are trying to do, or a video... if that is easier. But I need to first confirm that I understand you correctly.

hmm I would prefer to see what you are trying to do, and make sure I understand the issue before anything else. So please lets start with the screenshots that show step by step what you are trying to do, or a video... if that is easier. But I need to first confirm that I understand you correctly.
LordRazen commented 2021-03-06 11:19:02 +00:00 (Migrated from github.com)

Alright, here you go ^^
I didnt do changes on both views lately but both views are affected, that's why I think it must be something else.

Alright, here you go ^^ I didnt do changes on both views lately but both views are affected, that's why I think it must be something else.

Okay this looks like a naming convention conflict, so I will need to look at the JCB, or Joomla package on this extension to see what is wrong. You mentioned that you emailed it to me, yet I did not receive anything.

When you compile the demo component that ships with JCB does it also have the same behavior?

Sine if it does then we have a systems issue, meaning your system may be the cause. Should the demo component not have this issue, the we know it is the component you build... and we should look there.

I am still not getting this kind of behavior in any of my projects, and I have many...

Okay this looks like a naming convention conflict, so I will need to look at the JCB, or Joomla package on this extension to see what is wrong. You mentioned that you emailed it to me, yet I did not receive anything. When you compile the demo component that ships with JCB does it also have the same behavior? Sine if it does then we have a systems issue, meaning your system may be the cause. Should the demo component not have this issue, the we know it is the component you build... and we should look there. I am still not getting this kind of behavior in any of my projects, and I have many...
LordRazen commented 2021-03-06 14:46:26 +00:00 (Migrated from github.com)

Here you go.

Here you go.

When you compile the demo component that ships with JCB does it also have the same behavior?

When you compile the demo component that ships with JCB does it also have the same behavior?
LordRazen commented 2021-03-07 11:00:49 +00:00 (Migrated from github.com)

o_O It doesnt.

So seems like it's not necessarily a JCB error, but I still wondered since it happened with a version change. So I imported the JCB Package to my online test environment where there's still JCB 2.12.6. Compiled and the error also happened.

Now I still wonder: Where would I have to search for the problem? I went through all the JCB settings and checked if everything is correct... it seemed like it...

o_O It doesnt. So seems like it's not necessarily a JCB error, but I still wondered since it happened with a version change. So I imported the JCB Package to my online test environment where there's still JCB 2.12.6. Compiled and the error also happened. Now I still wonder: Where would I have to search for the problem? I went through all the JCB settings and checked if everything is correct... it seemed like it...

I think this is a naming convention clash... try renaming your view, and remove any custom JavaScript you may have placed on the page.

I think this is a naming convention clash... try renaming your view, and remove any custom JavaScript you may have placed on the page.
LordRazen commented 2021-04-19 15:06:42 +00:00 (Migrated from github.com)

Did so. Renamed the views, dont have any custom JavaScript - no results.

I tried to debug, but I'm new to that area of Joomla. I think the id of the edited item gets lost, but I dont know where. Any help is welcome here ^^

Did so. Renamed the views, dont have any custom JavaScript - no results. I tried to debug, but I'm new to that area of Joomla. I think the id of the edited item gets lost, but I dont know where. Any help is welcome here ^^
LordRazen commented 2021-04-19 19:08:36 +00:00 (Migrated from github.com)

I did some further research and found that somehow, the System Name, Name and Name in Code are responsible or related to the bug. Sometimes I can get the name right and everything works (on a new dummy component), sometimes I get the bug.

Are there any naming conventions for those names?

Edit: It only seems to happen on names similar to the original name. I dont know how the internal Joomla code works here. I guess some old code is interferring. Is there some kind of code cleanup or any way I could find out what this could be?

I did some further research and found that somehow, the System Name, Name and Name in Code are responsible or related to the bug. Sometimes I can get the name right and everything works (on a new dummy component), sometimes I get the bug. Are there any naming conventions for those names? Edit: It only seems to happen on names similar to the original name. I dont know how the internal Joomla code works here. I guess some old code is interferring. Is there some kind of code cleanup or any way I could find out what this could be?
LordRazen commented 2021-04-26 11:21:42 +00:00 (Migrated from github.com)

I found the bug:

https://docs.joomla.org/J3.x:File_Structure_and_Naming_Conventions
There are reserved words which can't be used in names of classes and components. An example is the word "model" (in any case) for model classes (except "model" that must be second part of that class name)

The "Name in Code" included the word "Model" within my component.

I recommend to add this little detail to the tooltip.

It really breaks your neck if you're not 100% familiar with the Joomla. I searched for this for like 5 days now...

I found the bug: https://docs.joomla.org/J3.x:File_Structure_and_Naming_Conventions `There are reserved words which can't be used in names of classes and components. An example is the word "model" (in any case) for model classes (except "model" that must be second part of that class name)` The "Name in Code" included the word "Model" within my component. I recommend to add this little detail to the tooltip. It really breaks your neck if you're not 100% familiar with the Joomla. I searched for this for like 5 days now...

Sorry about that... did not see that coming ;) I know the pain of these kind of snags... awful... but well done for pressing on!

So thank you for pointing that out... I have updated the tool-tip with the link you gave.

Sorry about that... did not see that coming ;) I know the pain of these kind of snags... awful... but well done for pressing on! So thank you for pointing that out... I have updated the tool-tip with the link you gave.
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#686
No description provided.