? ? ? Success

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
22 Mar 2019

This PR is a rebase of #22735 for 4.0

This PR adds frontend editing to com_contact.

Summary of Changes

Adding form view and accompagning controller and model to com_contact frontend

Testing Instructions

  • Test adding and editing contacts from frontend. If the user is authorised, he should see an edit link in the category view and contact view. The category view additionaly has a "New" button.
    The featured view doesn't have any such links.
    There is a menuitem to point to create new contacts.

  • Test that data doesn't get lost when saving (especially data not available to edit in frontend vs backend).

  • Test especially also ACL. JSST should look over it for possible security issues.

Expected result

Works

Actual result

Frontend editing not possible.

Documentation Changes Required

A new help page will be needed. Possibly also other doc pages.

avatar Bakual Bakual - open - 22 Mar 2019
avatar Bakual Bakual - change - 22 Mar 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Mar 2019
Category Administration com_contact Language & Strings Front End NPM Change
avatar Bakual
Bakual - comment - 22 Mar 2019

Some testing was already be done in the original PR. But this needs to be properly retested since there are a lot of differences (not a simple rebase).

There were two issues raised by @kofaysi which I have looked at now:

  • Cache: Cache will now be disabled if a user is logged in. This behavior is similar to com_content.
  • Duplicate Alias will not be resolved automatically. While com_content does that by appending a number, it's something that is done in com_content both in front- and backend. One can add this in com_contact as well, but it's out of scope fro this PR. For now frontend behavior will be same as backend.
avatar brianteeman
brianteeman - comment - 22 Mar 2019

In Joomla 4 we are really trying not to have useless _DESC strings unless they are absolutely necessary - they dont appear to be here

avatar Bakual
Bakual - comment - 22 Mar 2019

In Joomla 4 we are really trying not to have useless _DESC strings unless they are absolutely necessary - they dont appear to be here

True. Forgot that those were removed in 4.0 when I rebased the PR.
Should I just remove all of them or is there one which needs to stay?

edit: Just removed all of them.

avatar Bakual Bakual - change - 22 Mar 2019
Labels Added: ? NPM Resource Changed ?
avatar joomla-cms-bot joomla-cms-bot - change - 22 Mar 2019
Category Administration com_contact Language & Strings Front End NPM Change Administration com_contact Language & Strings Front End
avatar Bakual Bakual - change - 22 Mar 2019
Labels Removed: NPM Resource Changed
avatar brianteeman
brianteeman - comment - 22 Mar 2019

Thanks @Bakual

avatar infograf768
infograf768 - comment - 25 Mar 2019

@Bakual
Please correct the contact admin model to include a similar code to what we have for com_content
https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_content/Model/ArticleModel.php#L632-L649

Also, we just added in 3.9 this
#24216
and I guess we should o the same for contact.

avatar Bakual
Bakual - comment - 25 Mar 2019

@infograf768 First one is code in the administrator model. Which means that bug already exists in com_contact backend form. So it's unrelated to this PR and can be done in a separate one.

The second one I don't understand the issue it tries to solve. I could change categories just fine in frontend and don't see a reason to prevent this.
Is this related to workflows? If so then it doesn't apply to contacts as it doesn't use workflows.

avatar Bakual
Bakual - comment - 25 Mar 2019

@infograf768 As discussed in Glip I added code to prevent changing the language of already associated contacts.
I've not touched anything related to categories. That should be done in separate PRs if needed (I don't see the need yet).

avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Apr 2019
Category Administration com_contact Language & Strings Front End Administration com_contact Front End
avatar jduerscheid
jduerscheid - comment - 19 Oct 2019

There is some additional styling necessary


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

avatar jduerscheid
jduerscheid - comment - 19 Oct 2019

There is some additional styling necessary


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

avatar jduerscheid
jduerscheid - comment - 19 Oct 2019

Screenshots to the Stylingscreen shot 2019-10-19 at 10 25 40screen shot 2019-10-19 at 10 25 41


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

avatar Bakual
Bakual - comment - 19 Oct 2019

Can you check if this styling issue specific to the contact edit form? I'd expect it to be the same as in the article edit form. If the same issue exists there as well, it's out of scope of this PR.

avatar jduerscheid
jduerscheid - comment - 19 Oct 2019

Can you check if this styling issue specific to the contact edit form? I'd expect it to be the same as in the article edit form. If the same issue exists there as well, it's out of scope of this PR.

The styling in the editform is correct. But not in the list view of the Category. Please look to the added Screenshots

avatar Bakual
Bakual - comment - 19 Oct 2019

I'm currently unable to check this myself as my 4.0 installation is broken. If someone can check why that is, I'm more than happy.

avatar Bakual Bakual - change - 4 Dec 2019
Labels Added: Conflicting Files
avatar joomla-cms-bot joomla-cms-bot - change - 4 Dec 2019
Category Administration com_contact Front End Administration com_contact Language & Strings Front End
avatar Bakual
Bakual - comment - 4 Dec 2019

Merged 4.0-dev so it's up to date again.
Adjusted the icons so they match the changes in template. Eg using Font Awesome class now.

Should be testable again.

avatar infograf768
infograf768 - comment - 5 Dec 2019

test on multilingual site, frontend

Creating a new contact in frontend by super user or author
Impossible to choose category (No field). Selecting language works fine.
Error displays
Screen Shot 2019-12-05 at 10 42 15
In backend we can see the new contact is created in the Uncategorised category.

Editing an existing contact in frontend (as super User)
Category should display as greyed (but field is not present), possible to change contact language although it should also be greyed.

Please look how we do for articles creation and edit.

avatar Bakual
Bakual - comment - 5 Dec 2019

When I try to create a new contact, I can select the category just fine from any available category, be it specific to a language or "All". The field is under "Publishing", same place it is for articles.

I'm also able to change language and category of a contact as I would expect.

As I wrote before, I don't understand the category issue and thus if something needs to be fixed it has to be done separately.

I've tested with articles, and it is broken there. So I surely will not do like there ?

avatar infograf768
infograf768 - comment - 7 Dec 2019

Now saw the category field...
Will try asap to explain again the issue in multilingual concerning contacts assigned to a specific user.

avatar Quy Quy - change - 7 Jan 2020
Labels Removed: Conflicting Files
avatar johnnydevs
johnnydevs - comment - 13 Jan 2020

Will this feature be available in Joomla 4? Currently using 3.9.14 and I think it would be very useful!

avatar Bakual
Bakual - comment - 13 Jan 2020

@johnnydevs Only if enough people successfully test it.

avatar johnnydevs
johnnydevs - comment - 14 Jan 2020

@Bakual I think it would be a great feature, I'm willing to test it also :)

avatar Bakual
Bakual - comment - 14 Jan 2020
avatar Bakual
Bakual - comment - 25 Jan 2020

Resolved conflicts and did some codestyle. Testable again.

a05fd3d 2 Feb 2020 avatar astridx wip
avatar astridx
astridx - comment - 2 Feb 2020

I get this error:
0 Class 'Joomla\Component\Contact\Site\Helper\Route' not found
Error  0
Please see my PR to your branch.

avatar Bakual
Bakual - comment - 2 Feb 2020

Good find, that is because of the renaming in #27510
Thanks for your PR, I've already merged it.

e46c438 2 Feb 2020 avatar astridx cs
avatar astridx
astridx - comment - 2 Feb 2020

I checked a contact front end. I do not see the icon for editing, although I logged in as super user.
contact test

After applying this patch i could add a menu item for creating a contact.
Menus  Edit Item   test   Administration

I created the menu item.
create contact

I checked, if I see the edit icon with a already existing contact, when I log in as super user.
Single Contact

I was able to edit the already existing contact.
Single Contact(1)

I could submit a new contact.
Single Contact(2)

If I do not explicitly click on a category, this message appears when I create a contact. In my opinion, this is not an error. You could only make it more user-friendly.
Single Contact(3)

avatar astridx astridx - test_item - 2 Feb 2020 - Tested successfully
avatar astridx
astridx - comment - 2 Feb 2020

I have tested this item successfully on 94bb762


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

avatar Bakual
Bakual - comment - 2 Feb 2020

If I do not explicitly click on a category, this message appears when I create a contact. In my opinion, this is not an error. You could only make it more user-friendly.

I'd like to follow the behavior of com_content here. But haven't tested this exact behavior so can't say how it is done for articles.
Anyway, it would be easy to do afterwards as well. Would be great if this could be merged into 4.0 so it's part of beta.

avatar richard67
richard67 - comment - 2 Feb 2020

@Bakual @astridx I get the error alert "Category not found" after saving if I have select a category for the contact, regardless if the selected language for the contact is "all" or one of the installed languages, and regardless if this selection matches to the category's language or not. Is this expected? Everything else seems to work, including ACL. So shall I give it a good test or wait for some changes? Not sure now, am open for opinions and advise.

avatar richard67
richard67 - comment - 5 Feb 2020

@Bakual Could you solve conflict in file components/com_contact/tmpl/contact/default.php and update to 4.0-dev base branch?

And due to recently merged PR #27657 , there was a change of the fontawesome so-called style prefix. It's not really a prefix, it is the first css class used for the style, solid (fas), regular (far), brand (fab), and refers to the package where it's in. Not to be mixed up with the "fa-" prefix at the beginning of the icon name, this stays the same. So e.g. fa fa-eye changes to fas fa-eye, or (just as exmaple, not relevant in this PR) fa fa-joomla to fab fa-joomla (because it's in the brand backage). Could you update your icons? I think they all belong to "fas", but am not 100% sure. Maybe @N3REJ can check.
Update: Silly me. Changes for "fab" have been made long time ago by Brian. Only thing to do here is replace the fa by fas , so e.g. So e.g. fa fa-eye changes to fas fa-eye.

If you don't have time for that, I can make a PR to your branch for this PR so you can merge with 1 click. But before that you should update with the base branch (4.0-dev) e.g. by using the button here at the bottom.

Regarding my test I am a bit uncertain: I had the red error alert shown in Astrid's screenshot also when selecting an existing category. With com_content, when creating a new article in frontend, this doesn't happen in any of these 2 cases. I really would like to see this in beta but would feel more comfortable with givign a good test when this error alert would not be there :-)

avatar Bakual
Bakual - comment - 5 Feb 2020

Updated branch and adjusted the FA icons.
I'm looking into that category thing if I can reproduce and tackle it

avatar Bakual
Bakual - comment - 5 Feb 2020

I can't reproduce the "Category not found" thing. Do you know where it is coming from? Maybe related to menuitems?

avatar richard67
richard67 - comment - 5 Feb 2020

@Bakual Will check tomorrow after work. But PHP logfile or MySQL logfile didn't show anything special.

avatar richard67
richard67 - comment - 5 Feb 2020

@Bakual Strange .. now I can't reproduce it either. I've did (almost) same as last time when I've checked. New clean current 4.0-dev install, one new administrator user (not super user, just admin) created, no categories for contacts created, logged in on frontend as the new admin user and created the contact. No issue. Is late now, have to continue tomorrow.

One question: Is it correct that the frontend editing form doesn't show a field to assign a user to the contact? Or is it a mistake? Or did I just not see it?

avatar richard67
richard67 - comment - 5 Feb 2020

@astridx Could you test this again? Am curious if you get the error alert about category not found again. This time I didn't get it, last time I did.

avatar richard67
richard67 - comment - 5 Feb 2020

Maybe the last update to latest 4.0-dev base branch solved it? Maybe was something not ok in 4.0-dev when it was pulled in last time? Have to test more tomorrow.

avatar Bakual
Bakual - comment - 5 Feb 2020

One question: Is it correct that the frontend editing form doesn't show a field to assign a user to the contact? Or is it a mistake? Or did I just not see it?

From memory, which may serve me wrong at this time: In frontend, the user select field can't be used for security reasons. Since you would see a list of all users. So I didn't include that one.
You also can't change the author of an article for that same reason (I believe) in frontend.

avatar richard67
richard67 - comment - 5 Feb 2020

In frontend, the user select field can't be used for security reasons. Since you would see a list of all users.

Oh yes, that makes pretty much sense!

avatar richard67
richard67 - comment - 6 Feb 2020

Regarding my suggested change for check if published: we meanwhile have real null values for published up and down in J4 and don’t use the old nulldates anymore. I have to check tonight after work if my suggestion was correct or needs a fix maybe. If you are faster you can look up in com_content Frontensegeln editing how it is done there.

avatar Bakual
Bakual - comment - 6 Feb 2020

I did look up how it is done in com_content before I merged it ?

avatar richard67
richard67 - comment - 6 Feb 2020

@Bakual In J3? Or in J4 but before November 2019? In end of 2019 we have changed the nulldate stuff.

Or maybe it was October.

avatar richard67
richard67 - comment - 6 Feb 2020

@Bakual Can it be you once gave me write permission for your repository? I wanted to make a PR for your branch. Normally I do this by edfiting a file of the "victim" (=you) and then cancel. Then I have a branch in my repo based on the "victim's" branch, then I pull that and edit locally. But because I have write access it doesn't work like that, it edits directly in your repo. Because I don't have much time I've committed now directly to your branch.

I've changed the check for publish up and down times so it is like we have it here since the nulldate changes end of last year: https://github.com/joomla/joomla-cms/blob/4.0-dev/layouts/joomla/content/icons/edit.php#L36-L41.

If possible, could you revoke my write permission to your repo? I don't feel comfortable with having that permission on other people's repo.

avatar richard67
richard67 - comment - 6 Feb 2020

@Bakual P.S.: If one of my previous change suggestions was for a part of code which hadn't been touched by your PR before that, then it was a mistake, not by purpose. I wanted to change only those which you had touched.

avatar Bakual
Bakual - comment - 6 Feb 2020

Can it be you once gave me write permission for your repository?

That's because you're now a maintainer. When creating a PR I can set a checkbox to allow edits from maintainers.
That doesn't mean you have write permissions to my repo, just to that particular branch. Which is fine for me ?

avatar richard67
richard67 - comment - 6 Feb 2020

@Bakual Well thanks god it is possible to undo commits with git. Just in case I edit someone's PR and fall asleep because so late and then my forehead hits the keyboard ;-)

avatar astridx
astridx - comment - 9 Feb 2020

@richard67 @astridx Could you test this again? Am curious if you get the error alert about category not found again. This time I didn't get it, last time I did.

I have repeated my test. I did not get the error alert about "category not found" again.

avatar richard67
richard67 - comment - 9 Feb 2020

@astridx Is the test good enough to set a good result in the issue tracker? If so, pls. do.

avatar astridx astridx - test_item - 9 Feb 2020 - Tested successfully
avatar astridx
astridx - comment - 9 Feb 2020

I have tested this item successfully on 8f01ab1


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

avatar astridx astridx - test_item - 9 Feb 2020 - Tested successfully
avatar richard67
richard67 - comment - 9 Feb 2020

ah i was just a bit too impatient ;-)

avatar astridx
astridx - comment - 9 Feb 2020

@richard67 Since something similar has happened to me today, it may also be that I am too slow.

avatar richard67
richard67 - comment - 9 Feb 2020

@infograf768 Do you think you have time to test this, too? I am sure if there is a multilanguage issue we have not seen, you would see it.

avatar richard67 richard67 - test_item - 9 Feb 2020 - Tested successfully
avatar richard67
richard67 - comment - 9 Feb 2020

I have tested this item successfully on 8f01ab1


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

avatar richard67 richard67 - change - 9 Feb 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 9 Feb 2020

RTC


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

avatar rdeutz rdeutz - change - 11 Feb 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-02-11 10:09:35
Closed_By rdeutz
Labels Added: ?
avatar rdeutz rdeutz - close - 11 Feb 2020
avatar rdeutz rdeutz - merge - 11 Feb 2020

Add a Comment

Login with GitHub to post a comment