[BUG]: $this->styles and $this->scripts are null in site view #1122

Open
opened 2024-05-03 10:38:16 +00:00 by Polmock · 3 comments

What Happened?

File: com_<component_name>/src/View/<single_view_name>/HtmlView.php, method '_prepareDocument'.

I get 2 warnings because $this->styles and $this->scripts are null, so the foreach is supplied wrong elements.

I do not understand if it's ok that they are null (and not simply empty arrays or something else). Anyway, wrapping the 2 foreach with an if statement each verifying that the 2 properties are not null, suppresses the warnings.

Steps to reproduce the Bug

Compile a component with a site view and navigate an element.

Which Joomla version are you compiling in?

3.10.12

Which PHP version are you compiling in?

8.2.2

Which Joomla versions are you targeting?

4.4.4

Which PHP version are you targeting?

8.2.4

Which Web server is JCB running on?

Apache 2.4

Which Relational Database is JCB running on?

MySql 8.0

Which OS is JCB running on?

Windows 11

Which JCB version are you using?

3.2.1-rc5

Where in JCB did this issue occur?

Compilation of a component, Site View(admin_view)

On which browsers did you encounter the issue?

Firefox, Chrome

Additional Comments

No response

### What Happened? File: com_<component_name>/src/View/<single_view_name>/HtmlView.php, method '_prepareDocument'. I get 2 warnings because `$this->styles` and `$this->scripts` are null, so the foreach is supplied wrong elements. I do not understand if it's ok that they are null (and not simply empty arrays or something else). Anyway, wrapping the 2 `foreach `with an` if` statement each verifying that the 2 properties are not null, suppresses the warnings. ### Steps to reproduce the Bug Compile a component with a site view and navigate an element. ### Which Joomla version are you compiling in? 3.10.12 ### Which PHP version are you compiling in? 8.2.2 ### Which Joomla versions are you targeting? 4.4.4 ### Which PHP version are you targeting? 8.2.4 ### Which Web server is JCB running on? Apache 2.4 ### Which Relational Database is JCB running on? MySql 8.0 ### Which OS is JCB running on? Windows 11 ### Which JCB version are you using? 3.2.1-rc5 ### Where in JCB did this issue occur? Compilation of a component, Site View(admin_view) ### On which browsers did you encounter the issue? Firefox, Chrome ### Additional Comments _No response_
Polmock added the
Bug
label 2024-05-03 10:38:16 +00:00
Owner

Can you reinstall JCB, and give me a snapshot of the model,view classes of this view?

The models have all been updated to now have these new values and it is hard-coded to the model, so it seems like your JCB is not using the new template files found in the compiler folder.

Check that your templates are up-to-date, since the compiler location can be overwritten:
image

So I am asking that you make sure you are using then newest latest templates in the compiler folder found here: https://git.vdm.dev/joomla/Component-Builder/src/branch/3.x/admin/compiler

There are major changes in both the Joomla 3 and Joomla 4 templates and some of the issues you've reported speaks of wrong template files being used.

So to manually check some of the files that they match what is in our repository would be needed. I have seen in the past that I install a component, and that it does not update the files (don't ask me why) but I have seen this.

No if the files are indeed in sync and the issue continues, then we need to see the files that was build.

Can you reinstall JCB, and give me a snapshot of the model,view classes of this view? The models have all been updated to now have these new values and it is hard-coded to the model, so it seems like your JCB is not using the new template files found in the compiler folder. Check that your templates are up-to-date, since the compiler location can be overwritten: ![image](https://git.vdm.dev/attachments/a54d3c38-5bb0-45be-94fc-987a5cd2495f) So I am asking that you make sure you are using then newest latest templates in the compiler folder found here: https://git.vdm.dev/joomla/Component-Builder/src/branch/3.x/admin/compiler There are major changes in both the Joomla 3 and Joomla 4 templates and some of the issues you've reported speaks of wrong template files being used. So to manually check some of the files that they match what is in our repository would be needed. I have seen in the past that I install a component, and that it does not update the files (don't ask me why) but I have seen this. No if the files are indeed in sync and the issue continues, then we need to see the files that was build.
Owner

Please only use Firefox to compile you components... never use Chrome.

Please only use Firefox to compile you components... never use Chrome.
Author

I've updated to 3.2.1-rc6 version.
And manually replaced the compiler folder just to be sured that it's up to date.
I've downgraded php to 8.0.27 version (of course, I always use Firefox to compile).

But I have the same issue

I've updated to 3.2.1-rc6 version. And manually replaced the compiler folder just to be sured that it's up to date. I've downgraded php to 8.0.27 version (of course, I always use Firefox to compile). But I have the same issue
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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#1122
No description provided.