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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By eelkenet
      Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild.  
       
      What is it?
      The missing range slider Inputfield for Processwire. 
      What does it do?
      This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates.
      It includes a visible and editable value field, to override/tweak the value if required.  
      Features
      Min/max values Precision (number of decimals) Steps (Read more) Manual override of the selected value (will still adhere to the rules above) Usage
      Clone / zip repo Install FieldtypeFloatRange, this automatically installs the Inputfield Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field. To render the field's value simply echo `$page->field` Demo
      A field with Min=0, Max=1, Step=0.2, Precision=2

      Field with settings Min=0, Max=200, Step=0.25, Precision=2

       
      Todo
      Make the display-field's size configurable (will use the Input Size field setting)  Hopefully become redundant If it's usable for others I'll add it to the Modules list  
      Changelog
      v002
      - Fix issue where setting the step value to an empty value created problem with validation
      - Make the display-field optional 
      v001
      - Initial release
       
      Thanks!
       
       
    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. Field widths entered into the Template Field Widths inputfield are only applied if the Edit Template form is submitted with the Template Field Widths inputfield in an opened state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By adrian
      Tracy Debugger for ProcessWire
      The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS

       
      Integrates and extends Nette's Tracy debugging tool and adds 35+ custom tools designed for effective ProcessWire debugging and lightning fast development
      The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger
      Modules Directory: http://modules.processwire.com/modules/tracy-debugger/
      Github: https://github.com/adrianbj/TracyDebugger
      A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
    • By adrian
      This module allows you to automatically rename file (including image) uploads according to a configurable format
      This module lets you define as many rules as you need to determine how uploaded files will be named and you can have different rules for different pages, templates, fields, and file extensions, or one rule for all uploads. Renaming works for files uploaded via the admin interface and also via the API, including images added from remote URLs.   Github: https://github.com/adrianbj/CustomUploadNames
      Modules Directory: http://modules.processwire.com/modules/process-custom-upload-names/
      Renaming Rules
      The module config allows you to set an unlimited number of Rename Rules. You can define rules to specific fields, templates, pages, and file extensions. If a rule option is left blank, the rule with be applied to all fields/templates/pages/extensions. Leave Filename Format blank to prevent renaming for a specific field/template/page combo, overriding a more general rule. Rules are processed in order, so put more specific rules before more general ones. You can drag to change the order of rules as needed. The following variables can be used in the filename format: $page, $template, $field, and $file. For some of these (eg. $field->description), if they haven't been filled out and saved prior to uploading the image, renaming won't occur on upload, but will happen on page save (could be an issue if image has already been inserted into RTE/HTML field before page save). Some examples: $page->title mysite-{$template->name}-images $field->label $file->description {$page->name}-{$file->filesize}-kb prefix-[Y-m-d_H-i-s]-suffix (anything inside square brackets is is considered to be a PHP date format for the current date/time) randstring[n] (where n is the number of characters you want in the string) ### (custom number mask, eg. 001 if more than one image with same name on a page. This is an enhanced version of the automatic addition of numbers if required) If 'Rename on Save' is checked files will be renamed again each time a page is saved (admin or front-end via API). WARNING: this setting will break any direct links to the old filename, which is particularly relevant for images inserted into RTE/HTML fields. The Filename Format can be defined using plain text and PW $page variable, for example: mysite-{$page->path} You can preserve the uploaded filename for certain rules. This will allow you to set a general renaming rule for your entire site, but then add a rule for a specific page/template/field that does not rename the uploaded file. Just simply build the rule, but leave the Filename Format field empty. You can specify an optional character limit (to nearest whole word) for the length of the filename - useful if you are using $page->path, $path->name etc and have very long page names - eg. news articles, publication titles etc. NOTE - if you are using ProcessWire's webp features, be sure to use the useSrcExt because if you have jpg and png files on the same page and your rename rules result in the same name, you need to maintain the src extension so they are kept as separate files.
      $config->webpOptions = array(     'useSrcExt' => false, // Use source file extension in webp filename? (file.jpg.webp rather than file.webp) ); Acknowledgments
      The module config settings make use of code from Pete's EmailToPage module and the renaming function is based on this code from Ryan: http://processwire.com/talk/topic/3299-ability-to-define-convention-for-image-and-file-upload-names/?p=32623 (also see this post for his thoughts on file renaming and why it is the lazy way out - worth a read before deciding to use this module). 
       
       
      NOTE:
      This should not be needed on most sites, but I work with lots of sites that host PDFs and photos/vectors that are available for download and I have always renamed the files on upload because clients will often upload files with horrible meaningless filenames like:
      Final ReportV6 web version for John Feb 23.PDF

×
×
  • Create New...