Remove field or tab from backend profile edit

2 years 8 months ago - 2 years 8 months ago #326037 by lousyfool
Hi,

As per thread subject, I need to effectively have a CB field or tab removed from the profile edit form in the backend CB user management.

Reason:
One of my profile tabs contains a CB field of the type "Custom HTML" (actually, it's the only field in the tab), which displays content from another extension via a content plugin. Unfortunately, the content is wrapped into <form> tags, meaning it must not show in any profile edit form to avoid nested <form> tags.

Of course, not a problem to do so in the frontend; it's all working perfectly fine there.
But a big problem in the backend, since all methods such as ACL with CB Conditionals only act on the frontend, not on the backend.
I tried an Auto Action with trigger "onBeforeUserProfileEditDisplay" and a code action with jQuery "remove()" for the relevant IDs, which indeed removes the tab including field from the DOM, but on saving the profile it jumps to the backend landing page (no error or other message thrown), and profile changes are not saved. Obviously, there's more involved.

What method or trick can be used - other than hacking the core? There's got to be a way, or?

Please Log in to join the conversation.

2 years 8 months ago #326040 by krileon
Replied by krileon on topic Remove field or tab from backend profile edit
Surround your Custom HTML fields content with the following so it doesn't display in backend profile edit.

[cb:if reason!="edit"]CONTENT_HERE[/cb:if]

You can also use conditions in backend if you enable that in CB Conditional > Parameters.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

2 years 8 months ago - 2 years 8 months ago #326046 by lousyfool
Replied by lousyfool on topic Remove field or tab from backend profile edit
Hi Kyle,

Thanks for your prompt response.

krileon wrote: Surround your Custom HTML fields content with the following so it doesn't display in backend profile edit.

[cb:if reason!="edit"]CONTENT_HERE[/cb:if]

Unfortunately, this doesn't do anything in terms of removing the field from the backend profile edit form. It's still there the same way as before.

[cb:if reason="profile"]...[/cb:if] does remove it from there, but also from the frontend profile display. For some reason I had expected that reason="profile" means "profile view", but I guess it means "show nowhere ever in a profile context"... in whatever use case this may make sense.


krileon wrote: You can also use conditions in backend if you enable that in CB Conditional > Parameters.

With the first option not working, would you mind elaborating on this a bit more, please?
In CB Conditional I can select "User Parameters (params)" as field, then I still have the operators to choose from. and an empty value field... and I can't see or even only imagine what this could do for me here.

EDIT: Found it (see next post).


Just by the way, when clicking "Add AND Rows" or "Add OR Rows" in CB Conditionals, JS errors are thrown in the console, and at least the button selections for "User" and (if e.g. ACL is chosen for field) "Operator" of the first row are going grey.
EDIT: These errors prevent me from making it work, because I'll need a second row there...

Please Log in to join the conversation.

2 years 8 months ago - 2 years 8 months ago #326048 by lousyfool
Replied by lousyfool on topic Remove field or tab from backend profile edit
Aaaaahhh... found it: "Parameters" in the plugin settings! Ok, forget this, please... that's clear now.

But then I need a second CB Conditional row with AND, and as mentioned here above, currently the JS errors do not allow that. Hoping for a fix in CB Conditional rather soon then... thanks in advance.

Please Log in to join the conversation.

2 years 8 months ago #326052 by krileon
Replied by krileon on topic Remove field or tab from backend profile edit
That bug is in CB itself. Am working on a fix now.

forge.joomlapolis.com/issues/8675


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: lousyfool

Please Log in to join the conversation.

2 years 8 months ago #326064 by lousyfool
Replied by lousyfool on topic Remove field or tab from backend profile edit

krileon wrote: That bug is in CB itself. Am working on a fix now.

forge.joomlapolis.com/issues/8675


... and I see it's resolved and done there. Great, that was fast, many thanks! Now, how to get hold of the fix... "Target version CB 2.7" sounds a tad far ahead... :S

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.242 seconds

Facebook Twitter LinkedIn