Class Headers not being added for subsequent dynamic gets #998
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#998
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
OK ... it works and the use statements are added to the top of the model
Expected result
The use statements (both manual and the new power/class) should appear at the top of both model files ('course' and 'courselist').
Actual result
The use statements (both manual and the new power/class) appear in the first one ('course') but not in the second ('courselist').
System information (as much as possible)
Additional comments
I've tried a number of different things:
The helper file is getting the line "spl_autoload_register(function ($class)) " added. And the initial ('course') dynamic get is able to use the methods of the class as it should.
This is very strange that it basically just disabled the Class Header functionality for any view/dynamic get other than the one that it was associated with when the Power Header was added.
This is the first time I've used Powers on a JCB component, so maybe I missed something, but I thought that I could just create a power then manually add it to the header of each view/get so that I could use the class when needed.
I've watched the Powers Youtube video "JCB Powers Area Demonstrated" as well as the recent Super-powers videos; but I'm not seeing that I've missed something. Esp. considering it is working fine for the ONE dynamic get.
Is there something that I have missed?
JCB version 3.1.12 and 3.1.24 has a code difference of 20k lines of code. There is no way that they are the same. The new super powers are only fully stable from 3.1.24 (at least)
Further more it is very hard to make sense (from reading your comments) of what your doing without seeing pictures/screen-shots of the areas in question.
JCB has the same classes added to many different views, and as a result we know it works correctly. It is for that reason you will need to give more detailed screen-shots of what your doing.
OK ... just knowing that it should work, I'll work on trying to do some more testing here (including migrating to 3.1.24).
I'm going to close this for now.
OK ... I created a new clean Joomla instance, installed JCB 3.1.24 and then exported this project from the old site (which had a JCB instance that had been upgraded many times over the past couple years), and imported the project into this new Joomla/JCB instance, and getting the same problem.
So here is a step-by-step explanation of what I'm doing and getting:
Made sure that all the JCB Plugins were enabled
Made sure that the JCB compile options were activated
Created a new Power
Main settings:
Additional settings:
(continuing on next entry)
(continued from previous)
Added the power to the Class Headers area of the second Dynamic Get (courses - multiple/list view) NOTE: Also added a manual 'use Joomla\CMS\Factory' entry AND set the Power Header build to 'Always' (but I've tried with other settings as well)
Compiled the component
RESULTS:
In the course (singular) it results in the power being added to the header uses area:
In the courses (multiple/list-view) it results in NONE of the class headers being added (neither the power or the manual use-factory line)
When trying to use the class in the courses model, I get a Class not found error.
Not sure what else I should be doing to get the class/power (as well as the other use headers) to be added.
I've watched the JCB Powers Area Demonstrated youtube video several times and can't seem to find any reason why the headers are not being added to any other area of my component other than this one dynamic get (course).
Any ideas where to look for a possible setting or something else that might be causing these headers to not be added?
(OK Dumb user error)
After trying all sorts of things, including trying to add this to the header of various other views, I found it was being added to some and not others.
When I tried to identify what the differences where when the headers were or were not being added I noticed that it was the type of dynamic get.
They were being added to all the getItem, but not any of the getListQuery gets.
So I looked again at the Class Headers ... and noticed that there is both:
I guess the bold 'getItem' wasn't enough to make that clear (maybe if they weren't initially collapsed and I would have seen the bold getListQuery I would have noticed :-o
So all is working properly, just needed to switch the location where the class header was added.