[BUG]: No custom class headers for site view controller #1320

Open
opened 2026-09-15 17:37:47 +00:00 by ConfidantCommunications · 2 comments

What Happened?

When I compile my component, it creates Controller classes in both /administrator and /site which correspond to my "Admin View" for World (I end up with WorldController.php in both places). I have a custom "Target Admin View Controller Header" but there is no control for "Target Site Admin View Controller Header", which is essentially what the file in /site is. So the WorldController in /site is not inheriting custom header code from anywhere, and I don't know how to make it so.

I don't have a site view called "World". I tried hard-coding my header into the SITE_VIEW_CONTROLLER.php file and it did not end up in the compiled component either.

Steps to reproduce the Bug

Add a custom class header to the in the admin view tab, Target Admin View Controller Header, then compile.

Which Joomla version are you compiling in?

6.0.3

Which PHP version are you compiling in?

8.3.27

Which Joomla versions are you targeting?

6.0.0

Which PHP version are you targeting?

8.3.27

Which Web server is JCB running on?

Joomla Docker image "joomla:5.4.0-php8.3". Apache 2

Which Relational Database is JCB running on?

mysqlnd 8.3.27

Which OS is JCB running on?

Alpine linux inside Docker on a Mac ARM64

Which JCB version are you using?

6.1.5

Where in JCB did this issue occur?

Compiler(admin_view), Admin View(admin_view)

On which browsers did you encounter the issue?

Firefox

Additional Comments

No response

### What Happened? When I compile my component, it creates Controller classes in both /administrator and /site which correspond to my "Admin View" for World (I end up with WorldController.php in both places). I have a custom "Target Admin View Controller Header" but there is no control for "Target Site Admin View Controller Header", which is essentially what the file in /site is. So the WorldController in /site is not inheriting custom header code from anywhere, and I don't know how to make it so. I don't have a site view called "World". I tried hard-coding my header into the SITE_VIEW_CONTROLLER.php file and it did not end up in the compiled component either. ### Steps to reproduce the Bug Add a custom class header to the in the admin view tab, Target Admin View Controller Header, then compile. ### Which Joomla version are you compiling in? 6.0.3 ### Which PHP version are you compiling in? 8.3.27 ### Which Joomla versions are you targeting? 6.0.0 ### Which PHP version are you targeting? 8.3.27 ### Which Web server is JCB running on? Joomla Docker image "joomla:5.4.0-php8.3". Apache 2 ### Which Relational Database is JCB running on? mysqlnd 8.3.27 ### Which OS is JCB running on? Alpine linux inside Docker on a Mac ARM64 ### Which JCB version are you using? 6.1.5 ### Where in JCB did this issue occur? Compiler(admin_view), Admin View(admin_view) ### On which browsers did you encounter the issue? Firefox ### Additional Comments _No response_
ConfidantCommunications added the Bug label 2026-09-15 17:37:47 +00:00
Owner

Do you have a site view with the same name as your admin view?

If you have enabled Add Edit View to Site Area when linking your admin view to your component, a separate site view with the same name can conflict with the generated edit view. In some parts of the compilation process, one view may take precedence, while elsewhere, the other may take precedence.

The admin view’s custom controller header should also carry over to its site-side edit view correctly. We therefore suspect that a separate site view with the same name may be causing a collision.

Could you check whether you have a conflicting site view and let us know what you find?

Do you have a site view with the same name as your admin view? If you have enabled **Add Edit View to Site Area** when linking your admin view to your component, a separate site view with the same name can conflict with the generated edit view. In some parts of the compilation process, one view may take precedence, while elsewhere, the other may take precedence. The admin view’s custom controller header should also carry over to its site-side edit view correctly. We therefore suspect that a separate site view with the same name may be causing a collision. Could you check whether you have a conflicting site view and let us know what you find?
Author

My admin view is World/Worlds. In the component config I do have Edit/Create Site View set to "Add+Menu". When I set this up originally I had attempted to have a World view for the Site View, but it was causing trouble and I remember seeing something in the tutorials which confirmed that it might happen that way. So I opted to rename the site view to Worldview, and I have a second site view called Worlds for seeing as a list. The Worldview has its own dynamic get named Worldview which retrieves from the World table.

When I compile, there is an additional site view generated for World still—I am guessing it is because of the "Add+Menu" setting I chose.

My admin view is World/Worlds. In the component config I do have Edit/Create Site View set to "Add+Menu". When I set this up originally I had attempted to have a World view for the Site View, but it was causing trouble and I remember seeing something in the tutorials which confirmed that it might happen that way. So I opted to rename the site view to Worldview, and I have a second site view called Worlds for seeing as a list. The Worldview has its own dynamic get named Worldview which retrieves from the World table. When I compile, there is an additional site view generated for World still—I am guessing it is because of the "Add+Menu" setting I chose.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1320