Skip to content

Commit

Permalink
Merge pull request #9 from halftrainedharry/patch-inject-user
Browse files Browse the repository at this point in the history
Fix insertion of user fields into existing MODX user tabs
  • Loading branch information
Boshnik authored Sep 2, 2024
2 parents 238915d + 67b3c93 commit 0c96825
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions assets/components/extrafields/js/mgr/inject/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Ext.ComponentMgr.onAvailable('modx-user-tabs', function() {
let issetField = false;
field.abs.forEach(abs => {
if (issetField) return;
let areas = abs.category_id.split('_');
if (!Ext.isEmpty(abs.category_id) && areas.length === 1 && tab_index === areas[0]) {
let areas = abs.tab_id.replace(/^user_tab_/i, '').split('_');
if (Ext.isEmpty(abs.category_id) && areas.length === 1 && tab_index == areas[0]) {
if (ExtraFields.utils.checkAbs(abs)) return;
field = Object.assign(abs, field);
if (tab_index) field.cls = 'main-wrapper';
Expand All @@ -28,9 +28,9 @@ Ext.ComponentMgr.onAvailable('modx-user-tabs', function() {
columns.items.forEach((column, column_index) => {
field.abs.forEach(abs => {
if (issetField) return;
let areas = abs.category_id.split('_');
let areas = abs.category_id.replace(/^user_tab_/i, '').split('_');
if (areas.length === 1) return;
if (tab_index !== areas[0] || column_index !== areas[1]) return;
if (tab_index != areas[0] || (column_index + 1) != areas[1]) return;
if (!Ext.isEmpty(abs.category_id)) {
if (ExtraFields.utils.checkAbs(abs)) return;
field = Object.assign(abs, field);
Expand Down

0 comments on commit 0c96825

Please sign in to comment.