Active
Project:
Computed Field Tools
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
12 Mar 2011 at 10:48 UTC
Updated:
28 Apr 2017 at 02:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
frakke commentedGreat idea with triggered or periodic updates. I will add this when the module is approved for Drupal.org :-)
Comment #2
sansui commentedThis looks like an interesting module that could be really useful. I have a social site where users enter their birthday and a computed field displays their age. This works fine except I'd like to be able to filter against views, and the values must be stored in the database.
Would be pretty nifty to have those values recompute on cron, and pick up recomputing where it left off each cron
Comment #3
khalor commentedDrush integration would be a great way to have periodic recomputation (as Rules can have problems with user privileges when executing periodic tasks)
Comment #4
frakke commentedHi Khalor,
I have created a separate issue regarding the drush implementation here: #1314082: Drush implementation
Comment #5
punges24 commentedWas anyone able to figure out how to use the Re-compute module to automatically re-calculate every day?
Thanks
Comment #6
frakke commentedI'm not the far away from releasing a working version.
You will be able to configure the interval and initial starting time from that interval to make sure that it is only run when it's ok.
Comment #7
punges24 commentedGreat! Cant wait for the new configuration.
I just wanted to say something to #2 if Sansui is still checking this thread - U have tried to use views to sort age after it being computed from of date and you still run into another problem which I am looking for a solution for. When you enter a max age if using the exposed filter between, it has a problem because the computed field saves the age as a decimal like 22.6 (it only saves as 22 if its computed on the birthday) and when you filter it if you put in 22 it will not pull up anyone older then 22.0 so 22.1 would not show up already.
Comment #8
sansui commentedYou don't have to save the value of the computed field with a decimal - you can round up or down to save as a whole number yes?
Comment #9
lavamind commentedI would be very interested in helping to test cron integration.
Comment #10
punges24 commentedYou can round up or down and save the field as a whole number but for what I was trying it would not work. I am working on something where the people we need to be able to sort by age and if its a whole number being rounded up or down it wont be 100% accurate. I am trying to find a way around this.
Comment #11
Kaloyan Petrov commentedWhat's the status of the Rules or scheduling integration?
Comment #12
andjules commented+1 following
Comment #13
frakke commentedIt's still not far away from beeng ready. It just takes a little more work than I expected to get it implemented the way I would like it to be.
For now you can use the drush commands in the latest dev-release to schedule cron runs. (That is, of course, if you have access to set up cron runs on your server).
Comment #14
cphilli12 commentedJust curios, I a bit new to the use of drush, if you copy the drush command you provided in the module (replace the parm of course with field name), Can I just paste that PHP command into the "Rules" module under "when cron runs" with the action "execute custom PHP" option?
Do I need the DRUSH module installed first? does drupal core understand drush commands?
Thanks so much frakke , I am so happy you created this!! just need to get it scheduled asap :)
Comment #15
khalor commentedcphilli12, drush is a command-line tool that runs on your web server, not Drupal/PHP per se. To use it you need to SSH into your server, then perform a drush command (as documented in the link in #4)
You can set up a similar (but better approach IMHO) to Rule's 'when cron runs' using drush and crontab on your web server, which will perform a drush action on a repeatable time frame. Plenty of documentation of crontab here on D.o (it's how Drupal cron should be called on most implementations), as well as drush. There's also some documentation here.
Comment #16
cphilli12 commentedThank you, i will follow your suggestion, i really appreciate the drupal community
Comment #17
cphilli12 commentedComment #18
PatchRanger commentedCan't imagine how cool realization of frakke will be, no doubt it'll be great.
Here is my modest implementation of Rules integration.
For now you can set only field type in Action setting form : nor batch size, nor entity type are implemented.
Tested with cron event.
Please review.
Comment #19
mxwitkowski commentedtried applying #18 patch to the latest dev version posted on April 26 and encountered two errors in applying the patch: Hunk #3 FAILED at 129. Hunk #4 FAILED at 221.
Comment #20
PatchRanger commentedI have re-rolled the patch for the latest dev.
I do not use Computed Field Tools currently and have not touched it for a long time - so it's just a re-roll without any improvement or even thorough testing. Though the patch should do the work.
Please review.
@mxwitkowski Enjoy!))
Comment #21
gruppler commentedIt seems to be working fine.
It would be great if we could specify specific entities to re-calculate. For example, by selecting a list of entities you expect to be affected by a change in another entity, you could create a loop in Rules and re-calculate the field for only those entities, rather than all entities of that type.
Comment #22
areikiera commentedI've manually applied the patch from #20 to the latest dev version, and I'm guessing that there is an incompatibility with the current dev version. Below are the details of the issue I've run into:
I've created a rule that recalculates a computed field on a cron run.
When I run cron manually, I'm first redirected to the 'Re-computing FIELD' page where I see the progress bar for the computed fields being updated, then I'm redirected to the 'Re-compute computed fields' page with messages about how many fields were recomputed and how long it took. However, when I view my 'Recent log messages', I don't see the 'Cron run completed' message.
When cron runs automatically, I believe some sort of re-direct loop occurs because in my 'Recent log messages' I get lots of the following errors:
Any help would be greatly appreciated! And thanks for this awesome module and the patch!
Comment #23
areikiera commentedChanging to active since the patch when applied to the current dev version might cause a pretty serious issue, as outlined in a previous comment.
Comment #24
areikiera commentedAny updates?
Comment #25
areikiera commentedJust checking in again. Really hoping that this feature will be implemented soon, be it PatchRanger's solution or the original one that frakke mentioned. In the meantime, it would be awesome if the patch could be updated to work with the current dev version.
If anyone's interested in taking this on, I may be able to put a bounty on completing this. Just contact me, if interested.
Comment #26
ssoulless commentedfollowing!
Comment #27
ssoulless commentedBy the way this feature should be an external module included in the core.
Comment #28
ekidman commentedI'd love this functionality also, except I'm on D6. Just following for future updates.
Comment #29
tr33m4n commentedHello,
For anyone still curious about this I managed to hack my way to a solution that worked for me, see my comment here. To use this in a rule, just execute the function using Rules execute PHP action. I solved the schedule/cron issue using Ultimate Cron and setting up a cron job in my custom module. There is information on the project page for invoking a cron job from a module.
Hope this helps
Dan
Comment #30
delacosta456 commentedhi
yes wee need full integration with rules please
thanks