Jump to content
teppo

Module: Process Changelog

Recommended Posts

Actually there was no need for version_compare(): hooking into something that doesn't exist doesn't seem to cause any issues. While hooking into savePageOrFieldReady would make sense, at this point I'm not ready to ditch 2.x support, and since that's not an option, I don't really see any benefit in it :)

Latest version, just pushed to GitHub, fixes one minor bug and adds support for saveFieldReady.

  • Like 4

Share this post


Link to post
Share on other sites

Thanks @teppo. Will put it on my to-do list to check.

  • Like 1

Share this post


Link to post
Share on other sites

Hey @teppo, I've just ran some tests and it seems both saves during inline editting and/or running Page Actions are now properly logged. Thanks! 

  • Like 5

Share this post


Link to post
Share on other sites

So, this is kind of a heads-up: I've just pushed version 1.3.2 of ProcessChangelog to GitHub, and this version includes a bunch of UI changes. Hopefully they make as much sense to you folks as they do for me.

To be honest the old look of the module was a bit too ProcessWire 2.0'ish, and I've also been meaning to add clickable action/template links etc. for a while now.

changelog-132-gui.png

  • Like 7

Share this post


Link to post
Share on other sites

hi teppo,

i totally missed this module... did you see my new SVN module for fields and templates?

maybe you could integrate it into your module? i think that would make sense. i planned to create an overview page, but it seems it would be better to integrate that into your module, as the work is already done and quite same from functionality perspective.

one idea to improve this list would be that you also integrate "versions" like i did in my SVN module. than one could make as many changes as one wanted and in the end bump the version number and see a list like that:

// show changes from version 0.1 to 0.2

user           | date of last change     | action                 | changes       |
-----------------------------------------------------------------------------------
admin          | 2.1.2016                | changed field body     | 4             |
admin          | 1.1.2016                | changed page sample    | 1             |

maybe you could also use the diff tool for page changes? i've not looked into your module yet, so this are wild ideas ;)

what do you think?

update: versions would totally make sense for both your and my module. having the option to set the version + add a comment (like a commit in github) and then making the version number clickable and see all changes for that version would be a great help.

Share this post


Link to post
Share on other sites

Hey man, love this module! This data has helped me many times. I was wondering though as I have been querying against this data in the database if you had any plan to add any other search options. I have had the need to find changes on individual items and being able to insert a text string for a field could be super helpful.

Share this post


Link to post
Share on other sites

Hey there @arjen totally forgot about this question, I did end up finding that thing and am now happily using it to keep an eye on changes. Super helpful module!

  • Like 2

Share this post


Link to post
Share on other sites

This module is great, thanks for sharing it. I am missing one thing that I would like to hear if it could be integrated. :-)

What I really would like to see, is what data has been changed. Just the data value. So when an input field changes value, I would like to know what that value is.

Share this post


Link to post
Share on other sites

Hi @teppo,

Bug report: (sometimes?) in the RSS the date shown is the Created date of the Post not the Modified timestamp. I've been able to live with this, however, should you have a minute or two, chould you please fix it?

Cheers

Edited by szabesz
typo

Share this post


Link to post
Share on other sites

@szabesz: so far I've been unable to reproduce this issue or figure out it's source. The RSS feed should use the timestamp column from database, and that in turn should be the date of the edit (according to MySQL, as this column is automatically set to CURRENT_TIMESTAMP). 

Are you sure that this issue only shows up at the RSS feed and not the main Changelog view too?

  • Like 1

Share this post


Link to post
Share on other sites

@Vayu Robins: thanks for your suggestion, but to be honest I'm a bit hesitant when it comes to this module and tracking values. I'm hoping to update my Version Control module to PW3 sometime soon, and perhaps after that I'll revisit this idea.

Just to be clear, there are a couple of reasons why I'm hesitant about this:

  • First of all that would require storing a lot of additional data, which could quickly become a performance issue. Sure, I could make this an optional feature, but all things considered I'm just not sure if it's really worth it.
  • Second of all storing and outputting such data would get really complicated really soon. It's easy as long as we're just talking about simple text or textarea type fields, but what about HTML, fieldtypes with a bunch of different data columns, and files or images? The easy way out would be to only support a limited set of fieldtypes, but I'm worried that this would be a slippery slope :)
  • And, finally, I'd like to draw some sort of a line between this module and Version Control. Version Control is the rather complex beast that allows you not just to view what was changed, but also makes it possible to switch between different versions of a page. Changelog was always intended as a simple tool for quickly checking who changed what and when.
  • Like 1

Share this post


Link to post
Share on other sites
10 hours ago, teppo said:

Are you sure that this issue only shows up at the RSS feed and not the main Changelog view too?

Thanks for taking a look at it. To tell the truth, I'm not quite sure what actually happens but in my RSS reader (Vienna) the log entries do not show up in the order of the timestamp column. Maybe a bug in Vienna?

I will take a closer look and investigate it more detail and report back.

Share this post


Link to post
Share on other sites

Thanks, @szabesz. You should probably check if the actual RSS feed has the items in correct order. Just open it in your browser and see how it works there.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, teppo said:

You should probably check if the actual RSS feed has the items in correct order. Just open it in your browser and see how it works there.

I am sorry for the false alarm, it was my mistake not to investigate what is actually going on before asking you to fix it. It appears that it is indeed Vienna which gets confused and turns – for example – "Tue, 08 Aug 2017 07:27:17 -0400" into "2017. 07. 27. at 14:23". It is a guess but it seems to me that 07:27 is turned into 07. 27. Either way, I need to pick a different RSS reader even though Vienna works well with other feeds but not this one. I just found Shrook for Mac which seems to be ok <pubdate>

  • Like 1

Share this post


Link to post
Share on other sites

Well, something fishy is still going on because both Vienna and Shrook have just reported log entries from yesterday, while I have already had lots of entries after that one too. I will further investigate this when I have the time but now I have asap work to do.

  • Like 1

Share this post


Link to post
Share on other sites

@szabesz: that seems pretty weird indeed. I guess it could have something to do with different timezone settings and such.. or not. For the time being I've updated the module to use the DATE_RSS constant instead of the 'r' date format for RSS feed dates, but as far as I can tell that should not make any actual difference. Just a precaution, really.

Anyway, let me know if you figure out anything new :)

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, teppo said:

Just a precaution, really.

Thank you! I've just updated the module and keep an eye on what is going to happen onwards.

Edited by szabesz
typo

Share this post


Link to post
Share on other sites

I've just updated this module on my local and development servers. On the local machine there were no problems, however, on the dev server after updating the site's gone down with a 500 error and the log shows "Compile Error:     Can't use method return value in write context (line 346 of /var/www/sm-prod-new/site/assets/cache/FileCompiler/site/modules/ProcessChangelog/ProcessChangelogHooks.module)".

The only way I can see to get the site back up and running is to remove the ProcessChangelong directory from the Site > Modules folder. Once back on the site though I still have the Changelog page in the menu, it just shows the message "The process returned no content."

If I try to reinstall the module I get the error message again and the site goes down. I'm running ProcessWire 3.0.62.

  • Like 1

Share this post


Link to post
Share on other sites

Once I tried to uninstall the module and I had the same result as you had. Luckily the module works so I reverted to database backup which I always perform before upgrades and I reinstalled the files.

I am also interested in how to solve it even though currently I do not have to....

Edited by szabesz
typo

Share this post


Link to post
Share on other sites

Sorry, @houseofdeadleg and @szabesz. Looks like one of my previous performance improvements caused this module to require PHP 5.5+ , which is probably the source of the issue you experienced.

The latest version pushed to GitHub reverts that particular change, so upgrading to the latest version should fix this issue.

  • Like 1

Share this post


Link to post
Share on other sites
Just now, teppo said:

require PHP 5.5+

Thanks for the quick update! However, I use PHP 5.6.31.

Share this post


Link to post
Share on other sites

Maybe I did not have the exact same issue, sorry for being misleading. I could "uninstall" the module by clicking on the button in the admin, but after that I deleted the module files too and I  got something very similar as explained by @houseofdeadleg. I just did not have time to investigate so I reverted to my backup.

Edited by szabesz
typo

Share this post


Link to post
Share on other sites
14 minutes ago, teppo said:

Sorry, @houseofdeadleg and @szabesz. Looks like one of my previous performance improvements caused this module to require PHP 5.5+ , which is probably the source of the issue you experienced.

The latest version pushed to GitHub reverts that particular change, so upgrading to the latest version should fix this issue.

Not a problem, thanks for the quick fix. Reinstalled and working perfectly :)

  • Like 1

Share this post


Link to post
Share on other sites

Hey @teppo - I just noticed that with Chrome, it is reporting that JS is disabled:

image.png.d4c05c8b06d9b6547460b8414e07de1b.png

It's fine with Firefox though.

 

Share this post


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 bernhard
      --- Please use RockFinder3 ---
    • By MoritzLost
      Cacheable Placeholders
      This module allows you to have pieces of dynamic content inside cached output. This aims to solve the common problem of having a mostly cacheable site, but with pieces of dynamic output here and there.  Consider this simple example, where you want to output a custom greeting to the current user:
      <h1>Good morning, <?= ucfirst($user->name) ?></h1> This snippet means you can't use the template cache (at least for logged-in users), because each user has a different name. Even if 99% of your output is static, you can only cache the pieces that you know won't include this personal greeting. A more common example would be CSRF tokens for HTML forms - those need to be unique by definition, so you can't cache the form wholesale.
      This module solves this problem by introducing cacheable placeholders - small placeholder tokens that get replaced during every request. The replacement is done inside a Page::render hook so it runs during every request, even if the response is served from the template cache. So you can use something like this:
      <h1>Good morning, {{{greeting}}}</h1> Replacement tokens are defined with a callback function that produces the appropriate output and added to the module through a simple hook:
      // site/ready.php wire()->addHookAfter('CachePlaceholders::getTokens', function (HookEvent $e) { $tokens = $e->return; $tokens['greeting'] = [ 'callback' => function (array $tokenData) { return ucfirst(wire('user')->name); } ]; $e->return = $tokens; }); Tokens can also include parameters that are parsed and passed to the callback function. There are more fully annotated examples and step-by-step instructions in the README on Github!
      Features
      A simple and fast token parser that calls the appropriate callback and runs automatically. Tokens may include multiple named or positional parameters, as well as multi-value parameters. A manual mode that allows you to replace tokens in custom pieces of cached content (useful if you're using the $cache API). Some built-in tokens for common use-cases: CSRF-Tokens, replacing values from superglobals and producing random hexadecimal strings. The token format is completely customizable, all delimiters can be changed to avoid collisions with existing tag parsers or template languages. Links
      Github Repository & documentation Module directory (pending approval) If you are interested in learning more, the README is very extensive, with more usage examples, code samples and usage instructions!
    • By Craig
      I've been using Fathom Analytics for a while now and on a growing number of sites, so thought it was about time there was a PW module for it.
      WayFathomAnalytics
      WayFathomAnalytics is a group of modules which will allow you to view your Fathom Analytics dashboard in the PW admin panel and (optionally) automatically add and configure the tracking code on front-end pages.
      Links
      GitHub Readme & documentation Download Zip Modules directory Module settings screenshot What is Fathom Analytics?
      Fathom Analytics is a simple, privacy-focused website analytics tool for bloggers and businesses.

      Stop scrolling through pages of reports and collecting gobs of personal data about your visitors, both of which you probably don't need. Fathom is a simple and private website analytics platform that lets you focus on what's important: your business.
      Privacy focused Fast-loading dashboards, all data is on a single screen Easy to get what you need, no training required Unlimited email reports Private or public dashboard sharing Cookie notices not required (it doesn't use cookies or collect personal data) Displays: top content, top referrers, top goals and more
    • By daniels
      This is a lightweight alternative to other newsletter & newsletter-subscription modules.
      You can find the Module in the Modules directory and on Github
      It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin.
      This module fits your needs if you...
      ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns *I have only tested it with PHP 7.x so far, so use on owners risk
      EDIT:
      Since 0.0.4, instructions and changelog can be found in the README only. You can find it here  🙂
      If you have questions or like to contribute, just post a reply or create an issue or pr on github, thanks!
    • By MoritzLost
      Sorry for the convoluted title. I have a problem with Process modules that define a custom page using the page key through getModuleInfo (as demonstrated in this excellent tutorial by @bernhard). Those pages are created automatically when the module is installed. The problem is that the title of the page only gets set in the current language. That's not a problem if the current language (language of the superuser who is installing the module) is the default language; if it isn't, the Process page is missing a title in the default language. This has the very awkward effect that a user using the backend in the default language (or any other language) will see an empty entry in the setup menu:

      This screenshot comes from my Cache Control module which includes a Process page. Now I realize the description sounds obscure, but for us it's a common setup: We a multiple bilingual sites where the default language is German and the second language is English. While the clients use the CMS in German, as a developer I prefer the English interface, so whenever I install a Process module I get this problem.
      As a module author, is there a way to handle this situation? I guess it would be possible to use post-installation hooks or create the pages manually, but I very much prefer the declarative approach. The page title is already translatable (through the __ function), but of course at the time of installation there is no translation, and as far as I'm aware it's not possible to ship translations with a module so they are used automatically. Could this situation be handled better in the core? I would prefer if the module installation process would always set the title of the Process page in the default language, instead of the language of the current user.
×
×
  • Create New...