Jump to content

Module: Process Changelog


teppo

Recommended Posts

@adrian, I'm not seeing that issue here. Any chance you could check your login page for a hidden input with name "javascript" and value "1"? This is how LoginHistory knows that you've got JS enabled, so if that's not there, then it's probably going to report it wrong.

Then again, if that doesn't exist, it shouldn't be able to get screen and window dimensions either (are those missing too?)

You're not using a custom login form, are you? :)

  • Like 1
Link to comment
Share on other sites

Hey @teppo - no idea why, but logins are now showing fine in Chrome. It's weird because yesterday it wasn't just my login attempts that were showing JS disabled and no flash info. 

I'll keep an eye on it.

Sorry to bother you!

 

  • Like 2
Link to comment
Share on other sites

  • 4 months later...
  • 6 months later...

With the Changelog activated I start receiving out of memory errors with the PW Backup:

Fatal error: Allowed memory size of XXXX bytes exhausted (tried to allocate 20480 bytes) in //www-office/wire/core/WireDatabaseBackup.php on line 1269

Uninstalling Changelog makes the backups run fine again.

ProcessWire 3.0.125 ,
Changelog   1.5.5
PHP 7.2 Apache 2.4
256 MB Memory

Is anyone else seeing this?

Update: I found out from a backup (when it worked) that the plug-in can collect huge amounts of data. I moved the info over to GitHub, with the details.

 

  • Like 1
Link to comment
Share on other sites

the fix is temporary, i fear - with the wrong settings the problem re-occurs. My log was becoming huge, probably only because of a cron-job cleaning up. (80.000 entries with lots of MB), all built up within a week.

If there would be a setting not to log system actions (or log them differently, maybe shorter) it would be easier to know what's going on with with the editors because their changes can be stored longer (not so many entries normally)?

Link to comment
Share on other sites

  • 3 weeks later...

Hi Teppo, 

I do not remember correctly, but maybe after switching a site from 7.0.x to PHP 7.1.x I started to get a lot of these:

PHP Notice: Undefined index: Previous page URL in .../ProcessChangelog/ProcessChangelog.module:810

Could it be possible to get rid of these?

Link to comment
Share on other sites

2 minutes ago, gottberg said:

Hi, thanks for the great module! Will be default in all my next PW-sites!

I wonder if there is anyway to setup a mail trigger if a page gets unpublished/published?

Try hooking into: https://processwire.com/api/ref/pages/published/ and https://processwire.com/api/ref/pages/unpublished/ and add a wireMail call as needed.

 

  • Like 1
Link to comment
Share on other sites

Can anyone confirm this is working with PW 3+ and how I access the ChangeLog with the V3 UI?

I have ChangeLog installed but see nothing listed under the Setup tab where my other Modules are listed.

According to the instructions...

Quote

When you install this module, it creates a new page into the Admin called Changelog (Settings > Changelog). This page contains a list of changes to pages on the site since the moment this module was installed. By clicking the more link next to each row reveals more information about that particular change.

I think this applies to PW UI pre UI Kit as the latest version only has a navigation structure of

  • Pages
  • Setup
  • Modules
  • Access

Cheers

Link to comment
Share on other sites

  • 1 month later...

Hi Teppo,

Thank you very much for your great work! I wonder if it would be possible to prevent a user to be logged. Let me explain, one of our sites has a synchronisation process which use a user 'synchro'. This automated process does not need to be logged, since there are a lot of changes made by this process. We only want to log 'regular administrative' users.

I suppose I can hook myself over your own hook, but I am not sure how to proceed.

I would like to something like:

if (thisUser or theseUsers) don't log.

 

Link to comment
Share on other sites

On 2/4/2019 at 11:55 PM, ceberlin said:

If there would be a setting not to log system actions (or log them differently, maybe shorter) it would be easier to know what's going on with with the editors because their changes can be stored longer (not so many entries normally)?

Latest version adds support for ignoring specific users and/or roles, so that may help a bit. There's no clean way to figure out what is a system action, so I think ignoring the guest user (or some other user/role you use to perform these automated actions) is the best solution we have at the moment.

Shorter duration for log rows matching some rule (such as a specific role/user) could be a potential future addition as well, in case there's demand for that sort of thing ?

On 2/25/2019 at 12:20 PM, szabesz said:

Hi Teppo, 

I do not remember correctly, but maybe after switching a site from 7.0.x to PHP 7.1.x I started to get a lot of these:


PHP Notice: Undefined index: Previous page URL in .../ProcessChangelog/ProcessChangelog.module:810

Could it be possible to get rid of these?

It's been a while (sorry!) so hopefully this has been resolved already. If not, let me know (preferably via GitHub issues, these are much easier for me to keep track of).

On 8/26/2019 at 7:45 PM, Peter Knight said:

Can anyone confirm this is working with PW 3+ and how I access the ChangeLog with the V3 UI?

I have ChangeLog installed but see nothing listed under the Setup tab where my other Modules are listed.

According to the instructions...

I think this applies to PW UI pre UI Kit as the latest version only has a navigation structure of

  • Pages
  • Setup
  • Modules
  • Access

Cheers

If this is still occurring, please open a GitHub issue (if possible). I've just tested the module with both Reno and (old) default admin theme's, and was unable to reproduce this. I'm not entirely sure of the specifics, but it seems that adding any published (and non-hidden) page under /processwire/setup/ brings it up in the menu, so not really sure where to start, except that perhaps make sure that you're not using any hooks / modules that might somehow alter menu behaviour.

It would be best if you could try this on a blank install: if the issue occurs there, it should be much easier for me to reproduce as well. If not, it's probably something specific to your current setup, which means that we'd have to start by figuring out what exactly is going on there ?

On 10/9/2019 at 4:41 AM, Guy Verville said:

Thank you very much for your great work! I wonder if it would be possible to prevent a user to be logged. Let me explain, one of our sites has a synchronisation process which use a user 'synchro'. This automated process does not need to be logged, since there are a lot of changes made by this process. We only want to log 'regular administrative' users.

Latest version (1.7.1) has two new configuration options (ProcessChangelogHooks config settings): ignored roles and ignored users. I think one of these should help with this ?

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

On 2/25/2019 at 2:49 PM, gottberg said:

Hi, thanks for the great module! Will be default in all my next PW-sites!

I wonder if there is anyway to setup a mail trigger if a page gets unpublished/published?

On 2/25/2019 at 2:54 PM, adrian said:

I realise it's been a while since this was posted (again: sorry!) but while some sort of email trigger might be an interesting future addition, at the moment what Adrian suggested is probably the fastest and easiest way to achieve this. That, or perhaps Field Change Notifier in case you prefer a GUI solution ?

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Hi @teppo - Happy New Year.

I wonder what you think about removing the "by " prefix from the username. I have a lot of users on one particular site and I often want to find a user by making use of the browser's autoselection when you start typing when a select field is focused. It still works as is, but it means I need to type: "by ajones" instead of just "ajones".

Thanks for considering. 

Actually, on a related note, it would be nice to be able to limit the shown users to certain roles, or at least those that have admin page-edit permissions.

Link to comment
Share on other sites

  • 2 weeks later...
On 12/31/2020 at 11:49 PM, adrian said:

I wonder what you think about removing the "by " prefix from the username. I have a lot of users on one particular site and I often want to find a user by making use of the browser's autoselection when you start typing when a select field is focused. It still works as is, but it means I need to type: "by ajones" instead of just "ajones".

Makes sense to me. It's removed in the latest release, though I also had to add a new label text before the input so that the meaning is still obvious.

On 12/31/2020 at 11:49 PM, adrian said:

Actually, on a related note, it would be nice to be able to limit the shown users to certain roles, or at least those that have admin page-edit permissions.

Just to clarify: you mean that there would be a new filter option for displaying only users with specific role / permission? If so, this does sound like a good idea. I'll add it as a new enhancement issue for now, it'll require a bit more thought (the filter GUI probably needs a bigger overhaul soon).

Link to comment
Share on other sites

6 minutes ago, teppo said:

Makes sense to me. It's removed in the latest release, though I also had to add a new label text before the input so that the meaning is still obvious.

Great - thanks!

6 minutes ago, teppo said:

Just to clarify: you mean that there would be a new filter option for displaying only users with specific role / permission? If so, this does sound like a good idea. I'll add it as a new enhancement issue for now, it'll require a bit more thought (the filter GUI probably needs a bigger overhaul soon).

Actually, I was thinking it would be an option in the modules' config settings so that we can completely exclude users with frontend roles, or the "guest" user as appropriate. But maybe an extra filter would actually be better so that those actions are still logged.

Link to comment
Share on other sites

14 hours ago, adrian said:

Actually, I was thinking it would be an option in the modules' config settings so that we can completely exclude users with frontend roles, or the "guest" user as appropriate. But maybe an extra filter would actually be better so that those actions are still logged.

If you check ProcessChangelogHooks settings, there are already options for ignoring specific roles and users, so the part about ignoring "guest" user is doable. Permission based filtering is not available, and I'm not entirely sure if it should be; perhaps a hook would be a better solution for this kind of granularity ?

Anyway, I'll keep the live filtering option on my todo list, as it seems like a useful addition.

  • Like 1
Link to comment
Share on other sites

On 1/11/2021 at 9:37 AM, teppo said:

Permission based filtering is not available, and I'm not entirely sure if it should be; perhaps a hook would be a better solution for this kind of granularity ?

Just a quick heads-up that the hook I mentioned is now implemented in the latest release. There's a new method called ProcessChangelogHooks::shouldLogPageEvent() for this, and all the existing checks have been moved there as well:

    /**
     * Should we log this Page event?
     *
     * @param Page $page
     * @param Field|null $field
     * @param string $operation
     * @return bool
     */
    protected function ___shouldLogPageEvent(Page $page, ?Field $field, $operation) {

 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Just released a new version (1.11.0) of Changelog. This version includes a schema update that requires action from a superuser, so the module will keep displaying a message when a superuser logs in until the update has been successfully executed.

Technically this schema update could be handled just like the one before, behind the scenes, but since this one involves adding new indexes... well, if the custom database table (process_changelog) has a lot of data, this update could take quite a while, and might even result in a timeout. As such, I think it's best to let a superuser handle it.

Just in case: the README.md file contains a simple PHP script that can be used if the update refuses to go through in the browser ?

---

I recently migrated some sites to a new server, and ran into a serious performance issue right off the bat. After the usual process of blaming everything from the host to the MySQL version and even most recent ProcessWire updates, I almost accidentally noticed that some of my own queries for the process_changelog table were taking a very long time.

Turns out there were ~2.5 million rows stored for the page in question, and no indexes whatsoever to help with those queries. "Whoops."

With some new indexes — and one loosely related query optimization — in place, the heaviest page requests now take a few hundred milliseconds on my low-budget server. Still not blazing fast, but quite an improvement over the ~10-15 seconds they used to take. Not to mention that having millions of changelog entries for one page is probably a bit of a border case anyway ?‍♂️

  • Like 5
Link to comment
Share on other sites

Hi @teppo - thanks for the update. I was a bit confused about how to get the update to trigger. Turns out I had to visit the settings page for the ProcessChangelogHooks module and then I got the notice and the update worked as expected.

  • Like 1
Link to comment
Share on other sites

10 hours ago, adrian said:

I was a bit confused about how to get the update to trigger. Turns out I had to visit the settings page for the ProcessChangelogHooks module and then I got the notice and the update worked as expected.

Good to hear that it worked, eventually. The update notice should show up once when any superuser logs in, and every time you load said module's config page ?

Link to comment
Share on other sites

  • 2 weeks later...

Hello @teppo I have just updated the module from v1.5.4 to v1.12.0 and there were two schema updates in sequence: #2 and #3. Currently in the Changelog Hooks module's setting Schema version shows number 4. Does that mean that the  schema updates were performed properly?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...