Jump to content

Module: Process Changelog


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 post
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 post
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 post
Share on other sites
On 2/3/2019 at 2:26 AM, ceberlin said:

Is anyone else seeing this?

I think this might be the source of something that @GhostRider was experiencing - perhaps he can confirm whether uninstalling this module fixes the backup problem.

Link to post
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 post
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 post
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 post
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 post
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 post
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 post
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 post
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 post
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 post
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 post
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 post
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 post
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 post
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 post
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 post
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 post
Share on other sites
6 hours ago, szabesz said:

Does that mean that the  schema updates were performed properly?

Yes 🙂

  • Like 2
Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By monollonom
      (once again I was surprised to see a work of mine pop up in the newsletter, this time without even listing the module on PW modules website 😅. Thx @teppo !)
      Github: https://github.com/romaincazier/FieldtypeQRCode
      Modules directory: https://processwire.com/modules/fieldtype-qrcode/
      This is a simple module I made so a client could quickly grab a QR Code of the page's url in the admin.
      There's not much to it for now, but if need be you can output anything using a hook:
      $wire->addHookAfter("FieldtypeQRCode::getQRText", function($event) { $event->return = "Your custom text"; }) You can also output the QR code on your front-end by calling the field:
      echo $page->qr_code_field; The module uses the PHP library QR Code Generator by Kazuhiko Arase. When looking for a way to generate a QR Code in PW I came across @ryan's integration in his TFA module. I'm not very familiar with fieldtype/inputfield module development so I blindly followed @bernhard (great) tutorial and his BaseFieldtypeRuntime. At some point I'll take a deeper look to make a module on my own.
      Some ideas for improvements :
      add the ability to choose what to ouput : page's url / editUrl / file(s) / image(s) / ... allow to output multiple QR codes ?
    • By Chris Bennett
      https://github.com/chrisbennett-Bene/AdminThemeTweaker
      Inspired by @bernhard's excellent work on the new customisable LESS CSS getting rolled into the core soon, I thought I would offer up the module for beta testing, if it is of interest to anyone.

      It takes a different approach to admin styling, basically using the Cascade part of CSS to over-ride default UiKit values.
      Values are stored in ModuleConfig Module creates a separate AdminThemeTweaker Folder at root, so it can link to AdminThemeTweaker.php as CSS AdminThemeTweaker.php reads the module values, constructs the CSS variables then includes the CSS framework Can be switched on and off with a click. Uninstall removes everything, thanks to bernhard's wonderful remove dir & contents function.
      It won't touch your core. It won't care if stuff is upgraded. You won't need to compile anything and you don't need to touch CSS unless you want to.

      It won't do much at all apart from read some values from your module config, work out the right CSS variables to use (auto contrast based on selected backgrounds) and throw it on your screen.
      You can configure a lot of stuff, leave it as it comes (dark and curvy), change two main colors (background and content background) or delve deep to configure custom margins, height of mastheads, and all manner of silly stuff I never use.

      Have been developing it for somewhere around 2 years now. It has been (and will continue to be) constantly tweaked over that time, as I click on something and find something else to do.
      That said, it is pretty solid and has been in constant use as my sole Admin styling option for all of those 2 years.

      If nothing else, it would be great if it can provide any assistance to @bernhard or other contributor's who may be looking to solve some of the quirkier UiKit behavior.
      Has (in my opinion) more robust and predictable handling of hidden Inputfields, data-colwidths and showIf wrappers.
      I am very keen to help out with that stuff in any way I can, though LESS (and any css frameworks/tools basically) are not my go.
      I love CSS variables and banging-rocks-together, no-dependency CSS you can write with notepad.



       

    • By opalepatrick
      I see old posts saying that repeaters are not the way to go in Custom Process Modules. If that is the case, when using forms (as I am trying to do) how would one tackle things like repeat contact fields where there can be multiple requirements for contact details with different parameters? (Like point of contact, director, etc) or even telephone numbers that have different uses?
      Just for background I am creating a process module that allows me to create types of financial applications in the admin area (no need to publish any of this, pure admin) that require a lot of personal or company information.
      Maybe I am thinking about this incorrectly?
    • By HMCB
      I ran across a reference to IftRunner module. The post was 6 years ago. I cant find it in available modules. Has it been pulled?
    • By tcnet
      PageViewStatistic for ProcessWire is a module to log page visits of the CMS. The records including some basic information like IP-address, browser, operating system, requested page and originate page. Please note that this module doesn't claim to be the best or most accurate.
      Advantages
      One of the biggest advantage is that this module doesn't require any external service like Google Analytics or similar. You don't have to modify your templates either. There is also no Javascript or image required.
      Disadvantages
      There is only one disadvantage. This module doesn't record visits if the browser loads the page from its browser cache. To prevent the browser from loading the page from its cache, add the following meta tags to the header of your page:
      <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> How to use
      The records can be accessed via the Setup-menu of the CMS backend. The first dropdown control changes the view mode.

      Detailed records
      View mode "Detailed records" shows all visits of the selected day individually with IP-address, browser, operating system, requested page and originate page. Click the update button to see new added records.

      Cached visitor records
      View modes other than "Detailed records" are cached visitor counts which will be collected on a daily basis from the detailed records. This procedure ensures a faster display even with a large number of data records. Another advantage is that the detailed records can be deleted while the cache remains. The cache can be updated manually or automatically in a specified time period. Multiple visits from the same IP address on the same day are counted as a single visitor.

      Upgrade from older versions
      Cached visitor counts is new in version 1.0.8. If you just upgraded from an older version you might expire a delay or even an error 500 if you display cached visitor counts. The reason for this is that the cache has to be created from the records. This can take longer if your database contains many records. Sometimes it might hit the maximally execution time. Don't worry about that and keep reloading the page until the cache is completely created.
      Special Feature
      PageViewStatistic for ProcessWire can record the time a visitor viewed the page. This feature is deactivated by default. To activate open the module configuration page and activate "Record view time". If activated you will find a new column "S." in the records which means the time of view in seconds. With every page request, a Javascript code is inserted directly after the <body> tag. Every time the visitor switches to another tab or closes the tab, this script reports the number of seconds the tab was visible. The initial page request is recorded only as a hyphen (-).

      Settings
      You can access the module settings by clicking the Configuration button at the bottom of the records page. The settings page is also available in the menu: Modules->Configure->ProcessPageViewStat.
      IP2Location
      This module uses the IP2Location database from: http://www.ip2location.com. This database is required to obtain the country from the IP address. IP2Location updates this database at the begin of every month. The settings of ProcessPageViewStat offers the ability to automatically download the database monthly. Please note, that automatically download will not work if your webspace doesn't allow allow_url_fopen.
      Dragscroll
      This module uses DragScroll. A JavaScript available from: http://github.com/asvd/dragscroll. Dragscroll adds the ability in view mode "Day" to drag the records horizontally with the mouse pointer.
      parseUserAgentStringClass
      This module uses the PHP class parseUserAgentStringClass available from: http://www.toms-world.org/blog/parseuseragentstring/. This class is required to filter out the browser type and operating system from the server request.
×
×
  • Create New...