cakephp3-bootstrap-helpers icon indicating copy to clipboard operation
cakephp3-bootstrap-helpers copied to clipboard

Combatible with cake php v4.1

Open hkosmidi opened this issue 4 years ago • 15 comments

This is a (multiple allowed):

  • [ ] bug

  • [x] enhancement

  • [ ] question

  • CakePHP Version: 4.6.1

What you did

I used your plugin with cake php v4.1 but got several errors

What happened

Some functions didn't have proper return type in deceleration and yield errors

What you expected to happen

I have updated the function calls in 2 commits. Could you please check if they are ok. Is there way to merge in your codebase so to use your plugin through composer? https://github.com/hkosmidi/cakephp3-bootstrap-helpers/commit/9c48d6591bc9f47a2bba4313a8a272d718f593a9 https://github.com/hkosmidi/cakephp3-bootstrap-helpers/commit/3ba820d2e923f28472e51b42be71fedf9cc5c26c

hkosmidi avatar Nov 13 '20 19:11 hkosmidi

did you try this branch ? https://github.com/Holt59/cakephp3-bootstrap-helpers/tree/cake4-bs4-1.0.0 But it is for bootstrap 4.

Erwane avatar Nov 16 '20 08:11 Erwane

No I haven't. I use bootstrap 3 for now

hkosmidi avatar Nov 16 '20 09:11 hkosmidi

can you make a PR ? with tests ? or i can do it if you prefer

Erwane avatar Nov 16 '20 09:11 Erwane

Sorry I have not made any test, I just added the appropriate return types in functions. Feel free of course to merge them if you think the commits are correct

hkosmidi avatar Nov 16 '20 09:11 hkosmidi

I've created https://github.com/Holt59/cakephp3-bootstrap-helpers/tree/cake4-bs3-1.0.0 with your two commits. This is 100% untested, I've only cherry-picked your two commits.

You can require it using "holt59/cakephp3-bootstrap-helpers": "dev-cake4-bs3-1.0.0".

Holt59 avatar Nov 16 '20 09:11 Holt59

I'm trying different notations for this project but i don't know how to maintain 4 versions with comprehensive tags.

one way is 4 branches (cakeX-bsY) with tag attached like this : 4.3.1 is cake4-bs3 version 1. The risk is a "^4.3" dependency in composer.json apps and the require should be ~4.3.0 to load cake4-bs3 and all fixes

One alternative is tag 43.0.0 for cake4-bs3, 44.0.0 for cake4-bs4 and write documentation to require ^43.0

Erwane avatar Nov 16 '20 10:11 Erwane

I've been thinking about it, and there are multiple issues... I think the best option would be to fork this to a cakephp4-bootstrap-helpers.

We could keep all development here, in custom branch names such as the ones we are using, and only push tags to the cakephp4- repository so there is no issue with composer.

Holt59 avatar Nov 16 '20 10:11 Holt59

Ok, looks better but what about bootstrap versions ? version 3.xx for bs3 and 4.xx for bs4 ? Bootstrap 5 is in beta

Erwane avatar Nov 16 '20 10:11 Erwane

Yes, 3.x.x for bs3, 4.x.x for bs4, etc. It's what's already done.

Holt59 avatar Nov 16 '20 10:11 Holt59

So here, you keep branches : cake3-bs3, cake4-bs3n cake4-bs4, etc etc maintain tags for cakephp3 with bootstrap 3 and 4 in 3.x.y and 4.x.y And push the dev in cake4-bsX branches to new repository cakephp4-bootstrap-helpers with tags 3.x and 4.x for bootstrap versions ?

No PR in the cake4-bootstrap-helpers repository ? This part sound weird. Logic is to keep cake4 dev in this new repository, and push fixes from cake3 to cake4 no ?

Erwane avatar Nov 16 '20 10:11 Erwane

Well, I'd say its a preference choice, I don't really mind:

  • Either we keep all development here and only push to the Cake 4 repository.
  • Or we separate development, Cake 3 here and Cake 4 on the other repository.

We could completely separate development and only cherry-pick when needed.

I've created the Cake 4 repository and registered it on packagist: https://github.com/Holt59/cakephp4-bootstrap-helpers (the v3.0.0 and v4.0.0 corresponds to the cake4-bs3 and cake4-bs4 branches here).

I've also added you as collaborator to both repository so you should receive an invite.

Holt59 avatar Nov 16 '20 10:11 Holt59

Thanks, i will check that. Why v3.0.0 ? you plan to use one branch by fix ? maybe branch v3.x and tags v3.0.0 for versions ?

Erwane avatar Nov 16 '20 10:11 Erwane

Because that's what it was called here :) But it should be v3.0.x and we should have a v3.x branch:

  • v3.x — Latest development branch for Bootstrap 3.
  • v3.0.x — Bug fixes for release v3.0.x (created after v3.0.0 is released).
  • Similar branches for Bootstrap 4.

I'll remove master and set the v4.x as master for Cake 4 and v3.x as master for Cake 3 — Or I could set v4.x as master for both.

Holt59 avatar Nov 16 '20 10:11 Holt59

I also added this commit https://github.com/hkosmidi/cakephp3-bootstrap-helpers/commit/8b0d5db39c7b6c6c7a3065d13a8aaf203bc02b5a in order for DateTimeWidget to play along. Hope this helps

hkosmidi avatar Jan 17 '21 11:01 hkosmidi

The cake4 support will be moved to this repository. https://github.com/Holt59/cakephp4-bootstrap-helpers And this PR should fix Helpers initialization https://github.com/Holt59/cakephp4-bootstrap-helpers/pull/3

Waiting for @Holt59

Erwane avatar Jan 18 '21 07:01 Erwane