? ? Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
10 Oct 2019

Pull Request for replace of #23366 .

Summary of Changes

Add menu items for fields and field groups below the "Contact" menu item in the admin menu.

On update, use script.php to add these new menu items so that lft and rgt are set correctly in the (nested) menu table.

Testing Instructions

If you have both MySQL and PostgreSQL, please test on both if possible.

Test 1: New installation

  1. Apply the patch on a clean 4.0-dev branch using git or merging manually, or apply it on an installation of current 4.0-dev using patchtester.
  2. If used patchtester on an existing installation in step 1, delete file configuration.php and delete all Joomla database tables in PhpMyAdmin or PhpPgAdmin (depending on your database type).
  3. Do a new installation, login to backend and check the available items below the "Contact" item in the admin menu.

Result: See section "Expected result" below.

Test 2: Update

  1. Update a 3.9.12 or staging to current 4.0-dev plus the patch of this PR applied by using the "Upload & Update" tab of the Joomla Update Component and the update zip container previously downloaded from following URL: https://test5.richard-fath.de/Joomla_4.0.0-beta1-dev-Development-Update_Package_2019-10-19_pr-26540.zip. ATTENTION: When working on a git repository you should know how to clean up your branch afte this test.
  2. Login to backend and check the available items below the "Contact" item in the admin menu.

Result: See section "Expected result" below.

Expected result

you have:

  • Fields
  • Fieldsgroup

below Contact menu item
Screenshot from 2019-10-10 19-39-04

Actual result

You don't have these 2 menu items below Contact component

Additional comments

We need to review how we deal with changes of content in nested tables when updating because issues with that are is quite hard to fix with update sql scripts. (personal consideration)

avatar alikon alikon - open - 10 Oct 2019
avatar alikon alikon - change - 10 Oct 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Oct 2019
Category SQL Installation
da7f315 10 Oct 2019 avatar alikon grr
avatar alikon alikon - change - 10 Oct 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 10 Oct 2019
Category SQL Installation SQL Installation Postgresql
avatar joomla-cms-bot joomla-cms-bot - change - 10 Oct 2019
Category SQL Installation Postgresql Administration com_contact SQL Installation Postgresql
avatar alikon alikon - change - 10 Oct 2019
The description was changed
avatar alikon alikon - edited - 10 Oct 2019
avatar alikon alikon - change - 10 Oct 2019
Title
[WIP][4.0] add fields items to contact menu
[4.0] add fields items to contact menu
avatar alikon alikon - edited - 10 Oct 2019
avatar richard67
richard67 - comment - 10 Oct 2019

I think it will need some update sql script for that, too. If there is some 4.0-*.sql already existing which deals with these menu items, this one can be modified before we are in beta, otherwise or if you are not sure, make a new one. I can help with that on weekend. Edit: Just after I typed that I did read statement in the description about update script not needed.

avatar alikon
alikon - comment - 10 Oct 2019

we need to deeply review how we provide updates ---- if we are talking about sql
maybe i'm a dumb
...but it has been quite hard 4 me to to deliver this PR ....
update path without a stored procedure could be full of issues.... when you are talking about nested set tables, then cannot be a matter for easy/silly update .... but... maybe i'm too silly 😄

avatar brianteeman
brianteeman - comment - 10 Oct 2019

That's why I asked someone else to do it :)

avatar richard67
richard67 - comment - 10 Oct 2019

Hmm, thinking more about it: If it is really ok in 3.9 and not ok in 4.0, maybe there is already some 4.0.0-*.sql update script which removes those menu items? If this is the case, then this update script has to be changed. I can check that on weekend, but tonight and tomorrow night I won't have time.

avatar richard67
richard67 - comment - 10 Oct 2019

Well, I just checked: Seems there is no 4.0 update sql deleting those menu items, so everything should be ok, no update sql needed.

avatar alikon
alikon - comment - 10 Oct 2019

let me clarify...
no better
let me try to explain myself as better as I can ..
when nested set tables are in play..
imho there are no static script that can save your ass

avatar richard67
richard67 - comment - 10 Oct 2019

Correct.

avatar alikon
alikon - comment - 10 Oct 2019

you cannot guess what are the different lft,rgt values for all installation--- so
the update path should be at least careafully considered those different situation
my answer ----maybe we should consider a stored procedure......or
i'm open to feedaback

avatar richard67
richard67 - comment - 10 Oct 2019

but shouldn't the "rebuild" button do that after an update?

avatar alikon
alikon - comment - 10 Oct 2019

are you talking about menus table only ?
i'm talking about the whole update process---- i.e assets table .... etc
better ... i'm talking about an update path where nested set table are deeply involved

avatar richard67
richard67 - comment - 10 Oct 2019

Well I did not wanna speak against it, I only asked for my better understanding.

avatar alikon
alikon - comment - 10 Oct 2019

i hope i've at least instilled some grams of curiosity 😃

avatar brianteeman
brianteeman - comment - 10 Oct 2019

its also why I would not have had any 4.0sql update files at all and just done them all at once when we get to beta. just creates a lot of useless files that will be deleted

c3bffc4 11 Oct 2019 avatar alikon CS
avatar Quy
Quy - comment - 11 Oct 2019

Add a separator between Categories and Fields.

avatar alikon
alikon - comment - 11 Oct 2019

after a more proof review of 3.x we still need an update sql .... i was wrong

avatar joomla-cms-bot joomla-cms-bot - change - 13 Oct 2019
Category SQL Installation Postgresql Administration com_contact Administration com_admin com_contact SQL Installation Postgresql
avatar alikon alikon - change - 13 Oct 2019
The description was changed
avatar alikon alikon - edited - 13 Oct 2019
avatar alikon
alikon - comment - 13 Oct 2019

the needed update is made now with PHP 😍

951675c 13 Oct 2019 avatar richard67 PHPCS
avatar richard67
richard67 - comment - 13 Oct 2019

@SniperSister @alikon and me know about this. I've made a PR to his branch to fix it, he will merge as soon as lunch finished, I think.

avatar richard67 richard67 - change - 13 Oct 2019
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 13 Oct 2019
avatar richard67
richard67 - comment - 13 Oct 2019

@SniperSister Tests are passing here now.

avatar richard67 richard67 - test_item - 13 Oct 2019 - Tested successfully
avatar richard67
richard67 - comment - 13 Oct 2019

I have tested this item successfully on 661f93b

Test 1 new installation - MySQL 5.7: OK.
Test 1 new installation - PostgreSQL 10.10: OK.
Test 2 update - MySQL 5.7: OK.
Test 2 update - PostgreSQL 10.10: OK.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26540.
avatar richard67
richard67 - comment - 13 Oct 2019

@brianteeman Could you test this, too? I've helped with updating testing instructions and making a zip package for an update test because Nicola is a bit busy with preparing for JoomlaDay Italy, so see the updated instructions for details.

avatar infograf768
infograf768 - comment - 14 Oct 2019

Installed on a 3.9.12

I get
Screen Shot 2019-10-14 at 12 18 20

and
Notice: Trying to get property 'version' of non-object in /Applications/MAMP/htdocs/trunkgitnew/administrator/components/com_joomlaupdate/Model/UpdateModel.php on line 1357

Contacts have no fields
Screen Shot 2019-10-14 at 12 21 32
All dashboards are empty. No way to access to database page.

No way to save the administrator menu to use Alternate preset in order to access database page
Save failed with the following error: Column 'publish_down' cannot be null

used directly the link
administrator/index.php?option=com_installer&view=database

2 problems for database
Used Update structure button.
1 problem remains and the button is no more displayed. Menus disappear.

avatar richard67
richard67 - comment - 14 Oct 2019

@infograf768 The first message about template not available is normal after the update but should disappear and not come again after having liogged in to backend for the first time and then having navigated 1 time withint the backend.

The 2nd message should be fixed when my database null date works will be finished. It normally does not appear on a pre 8.0 MySQL with normal configuration regarding session parameters and server variables, e.g. for strict mode. Did you test this on MySQL 8?

The SQL error and empty dashboards ... maybe I've made a mistake when packing the update zip package which is linked in the testing instructions for test 2? I have to check that tonight after work (German time).

avatar infograf768
infograf768 - comment - 14 Oct 2019

Did you test this on MySQL 8?

Nope.

avatar nadjak77 nadjak77 - test_item - 19 Oct 2019 - Tested unsuccessfully
avatar nadjak77
nadjak77 - comment - 19 Oct 2019

I have tested this item 🔴 unsuccessfully on 4f755bc

Deleted configuration.php and databasetables
new installation
applied patch
deleted browsercache and reload site
the two menue items for "fields" and "fields groups" do not appear


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

avatar richard67
richard67 - comment - 19 Oct 2019

@nadjak77 Wrong order of processing. It has to be

  1. Apply patch on a 4.0-dev or alpha-12. This applies the changes to joomla.sql.
  2. Remove configuration.php and clear database.
  3. Run new installation. This will use the changed joomla.sql.
  4. Check backend menu.

You have done the new installation and then applied the patch but then have not done new installation again, so your database did not include the changes here.

avatar richard67 richard67 - change - 19 Oct 2019
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 19 Oct 2019
avatar richard67
richard67 - comment - 19 Oct 2019

I've just updated the update package for Test 2 to latest nightly build of today.

Testers please follow exactly the testing instructions given in the description of this PR.

avatar richard67
richard67 - comment - 19 Oct 2019

@nadjak77 Please change back your testing result to "not tested" in the issue tracker. The test failed because you did not follow exactly the testing instructions. And if you have enough time, please test again in the right way, that would be very appreciated. Anyway thanks for testing, even if wrong now, because we need volunteers who help with testing.

avatar nadjak77 nadjak77 - test_item - 19 Oct 2019 - Tested successfully
avatar nadjak77
nadjak77 - comment - 19 Oct 2019

I have tested this item successfully on 4f755bc

thank you @richard67
I tried it again:
apply patch
delete configuration.php and database
reinstall joomla
the new items appear under contact


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

avatar tecpromotion tecpromotion - test_item - 19 Oct 2019 - Tested successfully
avatar tecpromotion
tecpromotion - comment - 19 Oct 2019

I have tested this item successfully on 4f755bc


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

avatar uthorat uthorat - test_item - 19 Oct 2019 - Tested successfully
avatar uthorat
uthorat - comment - 19 Oct 2019

I have tested this item successfully on 4f755bc


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

avatar Quy Quy - change - 19 Oct 2019
Status Pending Ready to Commit
avatar Quy
Quy - comment - 19 Oct 2019

RTC


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

avatar wilsonge wilsonge - change - 19 Oct 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-10-19 21:45:06
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 19 Oct 2019
avatar wilsonge wilsonge - merge - 19 Oct 2019
avatar wilsonge
wilsonge - comment - 19 Oct 2019

Thanks!

avatar astridx
astridx - comment - 20 Oct 2019

Thank you for making the custom fields usable again.
Now I'm wondering: how should third party developers integrate custom fields in Joomla 4? Is it recommended that you also change the table #__menu, or should you continue to use a sub menu?

avatar alikon
alikon - comment - 9 Nov 2019

Now I'm wondering: how should third party developers integrate custom fields in Joomla 4? Is it recommended that you also change the table #__menu, or should you continue to use a sub menu?

imo is matter of personal taste / consistency

Add a Comment

Login with GitHub to post a comment