Skip to content

Conversation

@richard67
Copy link
Member

@richard67 richard67 commented Dec 16, 2022

Pull Request for Issue #39408 .

Replacement for PR's #39408 and #39413 .

Summary of Changes

This pull request (PR) adds back the javascript files which have been removed by PR's #38823 and #39374 because they might still be used in layout overrides.

This also fixes the currently failing versioning step of the package build which currently also causes the 4.3 nightly builds to fail.

That was caused by PR #38823 not having them removed from file build/media_source/com_users/joomla.asset.json.

So this PR doesn't need to modify that file, it only needs to add back the js files from that PR, while from the other PR it also need to add back the assets to file build/media_source/com_templates/joomla.asset.json.

A @deprecated comment is added to the top doc block of each restored js file.

Testing Instructions

Test 1 - Package Build

It requires a development environment (Git clone of this repo, composer, npm) either on Linux or on Windows with WSL to run the build.php script.

  1. Checkout the current 4.3-dev branch where [4.3] Massmail: Fix validation #39374 has been merged in on December 13, 2022.
  2. Run php ./build/build.php --remote=HEAD --exclude-gzip --exclude-bzip2.
    Result: See section "Actual result BEFORE applying this Pull Request" below.
  3. Clean up everything with git clean -d -x -f and git checkout ..
  4. Checkout the branch of this PR. You can do that with commands git fetch upstream pull/39431/head:test-pr-39431 and then git checkout test-pr-39431.
  5. Repeat step 2.
    Result: See section "Expected result AFTER applying this Pull Request" below.

Test 2 - Updating from 4.2.6 with Layout Overrides

  1. Install Joomla 4.2.6.

  2. Create following layout overrides:

  • com_templates/template
  • com_users/mail
  1. Update to the patched package for this PR by using this custom update URL https://ci.joomla.org/artifacts/joomla/joomla-cms/4.3-dev/39431/downloads/60159/pr_list.xml or this package download https://ci.joomla.org/artifacts/joomla/joomla-cms/4.3-dev/39431/downloads/60159/Joomla_4.3.0-alpha2-dev+pr.39431-Development-Update_Package.zip .
    Result: The update succeeds.

  2. Verify that the layout overrides which you have created in step 2 are still working as before.
    Result: The layout overrides work as before.

Actual result BEFORE applying this Pull Request

Test 1 - Package Build

At the end of the output in the command window:

> [email protected] versioning
> node build/build.js --versioning

[Error: ENOENT: no such file or directory, lstat '/home/richard/lamp/public_html/joomla-cms-4.3-dev/build/tmp/1670929783/media/com_users/js/admin-users-mail-es5.min.js'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/home/richard/lamp/public_html/joomla-cms-4.3-dev/build/tmp/1670929783/media/com_users/js/admin-users-mail-es5.min.js'
}
`npm run versioning` did not complete as expected.

Expected result AFTER applying this Pull Request

Test 1 - Package Build

At the end of the output in the command window:

> [email protected] versioning
> node build/build.js --versioning

Timer: Versioning finished in 160 ms
Cleaning checkout in /home/richard/lamp/public_html/joomla-cms-4.3-dev/build/tmp/1670930708.
Cleaning vendors.
Cleanup complete.
Generating optimized autoload files
Generated optimized autoload files containing 2381 classes
Cleaning Composer manifests in /home/richard/lamp/public_html/joomla-cms-4.3-dev/build/tmp/1670930708.
Cleanup complete.
Workspace built.
Create list of changed files from git repository for version 4.3.0-alpha2-dev.
Delete folders not included in packages.
Build full package files.
Building Joomla_4.3.0-alpha2-dev-Development-Full_Package.zip... done.
Build full update package.
Building Joomla_4.3.0-alpha2-dev-Development-Update_Package.zip... done.
Build of version 4.3.0-alpha2-dev complete!

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

The deprecation of these js files has to be documented on manual.joomla.org . But since it was PR's #38823 and #39374 which made these files obsolete and so deprecated, it is not subject of this PR here to do that. Clarifications among maintainers is ongoing, and the deprecations will be documented at the end.

@richard67 richard67 changed the title [4.3] [WiP] Restore js files deleted with PR's #38823 and #39374 in order to be b/c for layout overrides [4.3] Restore js files deleted with PR's #38823 and #39374 in order to be b/c for layout overrides Dec 16, 2022
@richard67 richard67 marked this pull request as ready for review December 16, 2022 14:31
@drmenzelit
Copy link
Contributor

The deprecation of these js files has to be documented on manual.joomla.org . I need help with that because I don't have any experience with that. At least an existing example would be helpful.

@Hackwar already opened a PR for the manual but it is incomplete: joomla/Manual#68

and @brianteeman needs to add the deprecation on the manual too

@richard67
Copy link
Member Author

The deprecation of these js files has to be documented on manual.joomla.org . I need help with that because I don't have any experience with that. At least an existing example would be helpful.

@Hackwar already opened a PR for the manual but it is incomplete: joomla/Manual#68

and @brianteeman needs to add the deprecation on the manual too

Thanks @drmenzelit . I've decided to change the documentation part of this PR's description so it's more clear ;-)

@dgrammatiko
Copy link
Contributor

And also @drmenzelit you should rename the js as I suggested in #39161 because your changes there fall into the same category

@dgrammatiko
Copy link
Contributor

I have tested this item ✅ successfully on 66d64be

For the record, I'm not necessarily endorsing the idea of shipping dead code...


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39431.

@richard67
Copy link
Member Author

For the record, I'm not necessarily endorsing the idea of shipping dead code...

@dgrammatiko Me neither. But what should I do? Thanks a lot for testing.

@brianteeman
Copy link
Contributor

brianteeman commented Dec 16, 2022

and @brianteeman needs to add the deprecation on the manual too

no i dont need to do anything

@drmenzelit
Copy link
Contributor

And also @drmenzelit you should rename the js as I suggested in #39161 because your changes there fall into the same category

on my PR, that has to be reworked anyway, the change on the name of the js file is due to changes in the dependency....

@dgrammatiko
Copy link
Contributor

the change on the name of the js file is due to changes in the dependency....

@drmenzelit as I already wrote there the nodejs build tools allow you to rename the distribution files

@drmenzelit
Copy link
Contributor

the change on the name of the js file is due to changes in the dependency....

@drmenzelit as I already wrote there the nodejs build tools allow you to rename the distribution files

ok, thanks. I couldn't find your comment on the PR...

@obuisard
Copy link
Contributor

I have tested Test 1 OK.

Test 2: I cannot figure out why there is nothing in the diff editor after update for template overrides. The default behavior is that the diff editor gets the original file. I thought it was because of the CSS file changes.

@richard67
Copy link
Member Author

richard67 commented Dec 16, 2022

I have tested Test 1 OK.

Test 2: I cannot figure out why there is nothing in the diff editor after update for template overrides. The default behavior is that the diff editor gets the original file. I thought it was because of the CSS file changes.

Take the PR as it is or forget it and have a broken build. The pr fixes that and makes the overrides not fail with an exception. If something else doesn’t work as before, I don’t care. Find someone else who fixes that. I have done what I can to fix what others have broken.

Update: The failure with exception was the other override for the mass mail thing. But I‘m tired and won’t invest more time.

@obuisard
Copy link
Contributor

Take the PR as it is or forget it and have a broken build. The pr fixes that and makes the overrides not fail with an exception. If something else doesn’t work as before, I don’t care. Find someone else who fixes that. I have done what I can to fix what others have broken.

Update: The failure with exception was the other override for the mass mail thing. But I‘m tired and won’t invest more time.

I was not trying to offend you by any means Richard @richard67. I just wanted to make sure the behavior I encountered is 'ok' by adding my comment, so that Dimitris, or someone else testing the PR, can confirm it's ok.

Thank you Richard for your investment, it's been appreciated.

@richard67
Copy link
Member Author

@obuisard Sorry from me. I am just tired of these exhausting discussions and clarifications on Mattermost. I should have made the testing instructions more clear, not claiming everything works like before but just that views are not completely inoperable.

@obuisard
Copy link
Contributor

I understand, Richard @richard67, no need to apologize. I followed the conversations and it was a lot, indeed. There are decisions to make and people have different opinions. You've been very helpful in fixing the issues encountered, thank you 😊

@obuisard
Copy link
Contributor

I have tested this item ✅ successfully on 66d64be

Regardless of my previous testing comment, this PR does produces what it advertises.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39431.

@richard67
Copy link
Member Author

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39431.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Dec 17, 2022
@richard67
Copy link
Member Author

@obuisard I can confirm that the diff view is not shown when using the toggle button to show it. To make that work with a layout override from 4.2.x it could require modifications of the deprecated js file. It seems to use local storage in the event handler, and there might have been some changes about that. It would need to check the details but I have to do something else soon. I think that could be fixed with a follow up PR. Other stuff seems to work in the override edit view.

@obuisard
Copy link
Contributor

@obuisard I can confirm that the diff view is not shown when using the toggle button to show it. To make that work with a layout override from 4.2.x it could require modifications of the deprecated js file. It seems to use local storage in the event handler, and there might have been some changes about that. It would need to check the details but I have to do something else soon. I think that could be fixed with a follow up PR. Other stuff seems to work in the override edit view.

Thank you for checking it out Richard @richard67.

@richard67
Copy link
Member Author

@obuisard Possibly we should implement a special check in the override edit view if it has an updated override for itself, and if so, show some kind of alert in the edit view that it might not work because of that reason.

@obuisard obuisard added this to the Joomla! 4.3.0 milestone Dec 17, 2022
@obuisard obuisard merged commit 5bc91f4 into joomla:4.3-dev Dec 17, 2022
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Dec 17, 2022
@richard67 richard67 deleted the 4.3-dev-restore-deleted-assets-for-bc branch December 17, 2022 13:41
@obuisard
Copy link
Contributor

Thank you Richard @richard67 for your help in the matter and your patience throughout the discussions.

@dgrammatiko
Copy link
Contributor

Possibly we should implement a special check in the override edit view if it has an updated override for itself, and if so, show some kind of alert in the edit view that it might not work because of that reason.

Please don't, if there's a regression open an issue and assign it to me.

@richard67
Copy link
Member Author

Possibly we should implement a special check in the override edit view if it has an updated override for itself, and if so, show some kind of alert in the edit view that it might not work because of that reason.

Please don't, if there's a regression open an issue and assign it to me.

@dgrammatiko There is not really a regression. But if you create a layout override for com_templates/template in 4.2.x and then update to 4.3 (with this PR included because otherwise you would get an exception by the web asset manager when the default.php of the old override wants to load the obsolete js), the toggle to show the diff view doesn't work and the diff view is not shown when toggling to show that. We could fix that now for that particular case, but in general it can happen again in future when there is a change in the core for the default layout of the template view of com_templates. Therefore it could make sense to show that in that view somehow.

@dgrammatiko
Copy link
Contributor

Therefore it could make sense to show that in that view somehow.

It's a amortisation strategy I don't really like, to be honest. Overrides assume complete ownership of the layout + all the shenanigans (css, js, etc). It's more a lack of education or completely false assumptions from the users (ie js/css files are given and cannot go away or change completely their contents). My 2c anyways

@brianteeman brianteeman mentioned this pull request Apr 2, 2023
4 tasks
richard67 added a commit to richard67/joomla-cms that referenced this pull request Apr 2, 2023
Delete the js files and the asset once deleted with PR's joomla#38823 and joomla#39374 and then added back with PR joomla#39431 for b/c reasons.
richard67 added a commit to richard67/joomla-cms that referenced this pull request Apr 2, 2023
Delete the js files and the asset once deleted with PR's joomla#38823 and joomla#39374 and then added back with PR joomla#39431 for b/c reasons.
@richard67 richard67 mentioned this pull request Apr 17, 2023
4 tasks
HLeithner pushed a commit that referenced this pull request Jun 26, 2023
…#39374 (#40302)

* Finally delete deprecated javascript assets

Delete the js files and the asset once deleted with PR's #38823 and #39374 and then added back with PR #39431 for b/c reasons.

* Add the deleted files to script.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NPM Resource Changed This Pull Request can't be tested by Patchtester

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants