Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#6142 Added abbility to see which plugins attached to the event #modxbughunt #13324

Merged
merged 5 commits into from
Jul 7, 2017

Conversation

alroniks
Copy link
Collaborator

@alroniks alroniks commented Mar 3, 2017

What does it do?

It allows to see which plugins attached to system event on the events page.

Why is it needed?

When in the system a lot of plugins sometimes it can be useful so see which of them attached to events from events page. Or when we try to see which plugins work with specific event.

system settings - modx revolution

Related issue(s)/PR(s)

Partially fix for #6142

@Mark-H Mark-H added this to the v2.6.0 milestone Mar 3, 2017
@rtripault rtripault self-assigned this Mar 6, 2017
Copy link
Contributor

@rtripault rtripault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a small note about short array syntax (which is PHP 5.4+).

Also, i was wondering if we should display only active plugin (where(array('disabled' => false)) or style disabled plugins differently (rendered in the grid).

Otherwise 👍

$c = $this->modx->newQuery('modPlugin');
$c->leftJoin('modPluginEvent', 'modPluginEvent', 'modPluginEvent.pluginid = modPlugin.id');
$c->sortby('modPluginEvent.priority', 'ASC');
$c->where(['modPluginEvent.event' => $eventArray['name']]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While i would love to use the short array syntax, this would break compatibility to PHP 5.3.x

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, It's a hard to follow when it has become a habit. :)

@alroniks
Copy link
Collaborator Author

alroniks commented Mar 6, 2017

@rtripault I thought about to add marks for plugins, like Ace (disabled, locked), pdoTools (locked) and to avoid to change styles. My assumptions, that here we will have only readable info and disabled mostly applicable to form elements.

@rtripault rtripault removed their assignment May 15, 2017
@Mark-H
Copy link
Collaborator

Mark-H commented Jun 15, 2017

This looks useful, but can't be merged until the short array syntax is fixed ;)

@alroniks
Copy link
Collaborator Author

@Mark-H @rtripault Fixed short arrays and add statuses for plugins (see screnshot below)
system settings - modx revolution 1

$eventArray['plugins'] = '';
}

$eventArray['plugins'] = json_encode($eventArray['plugins']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the benefit of json encoding here and having to parse the json client side later ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, it's obsolete. I've fixed and removed this encoding/decoding.

@rtripault
Copy link
Contributor

All working as expected.
Just added a question about json encoding a value that would be json encoded later anyway

@rtripault rtripault merged commit 8d1e251 into modxcms:2.x Jul 7, 2017
rtripault added a commit that referenced this pull request Jul 7, 2017
* upstream/pr/13324:
  Remove obsolete json encoding/decoding
  Added readable statuses of the plugins
  Fixed short array syntax for compatibility with php 5.3
  #6142 Added abbility to see which plugins attached to the event on page with events #modxbughunt
@rtripault
Copy link
Contributor

Many thanks for your work and patience ;)

@alroniks alroniks deleted the feature-6142 branch July 7, 2017 13:25
@gpsietzema
Copy link
Contributor

#modxbughunt #1point to @rtripault

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants