Setting updateStrategy = FieldStrategy.IGNORED has no effect - sql-update

I add annotation on the field I need to update it to null.
#TableField(updateStrategy = FieldStrategy.IGNORED)
Mapper.updateById(order)
But It has no effect.

try updateStrategy=FieldStrategy.NEVER

Related

rack-timeout: turn off info/active logging

With the rack-timeout gem installed how is it possible to display ERROR only related logs? For example I would like to avoid having the below in my logs:
source=rack-timeout id=8a11a8ac3dadb59a4f347d8e365faddf timeout=20000ms service=0ms state=active
source=rack-timeout id=8a11a8ac3dadb59a4f347d8e365faddf timeout=20000ms service=49ms state=completed
source=rack-timeout id=ee947d4a291d02821ab108c4c127f555 timeout=20000ms state=ready
The following did not work:
Rack::Timeout.unregister_state_change_observer(:active)
The below may be on the right path but I'm having trouble testing:
Rack::Timeout::Logger.level = Logger::ERROR
(Note the class name was changed from Stage… to State… in v0.3.0)
In production I want to log at INFO level so I get a log message per request, but I don't want this noise from rack-timeout.
You can alter the STATE_LOG_LEVEL hash in the StateChangeLoggingObserver and change the log level used for the different states. I use this in my initialiser to prevent the ready and completed logs from showing:
Rack::Timeout::StateChangeLoggingObserver::STATE_LOG_LEVEL[:ready] = :debug
Rack::Timeout::StateChangeLoggingObserver::STATE_LOG_LEVEL[:completed] = :debug
My solution to this problem was to give rack-timeout its own logger.
Once you've done that, you can change its log level:
# config/initializers/timeout.rb
Rack::Timeout::Logger.logger = Logger.new("log/timeout.log")
Rack::Timeout::Logger.logger.level = Logger::ERROR
In config/initializers/rack_timeout.rb I added:
Rack::Timeout::Logger.disable if Rails.env.development?
More detailed options are described here: https://github.com/sharpstone/rack-timeout/blob/master/doc/logging.md
(Thanks #Sandip Subedi for the suggestion)
Read here for more information
https://github.com/heroku/rack-timeout#rails-apps-manually
or
https://github.com/heroku/rack-timeout/blob/master/doc/settings.md
You could also try this code, though untested.
Rack::Timeout::StageChangeLoggingObserver.logger = logger = ::Logger.new(STDERR)
logger.level = ::Logger::DEBUG
logger.formatter = ->(severity, timestamp, progname, msg) {"[#{timestamp}] #{msg} at=#{severity.downcase}\n" }

tt_address: add categorys of address to the template

Is it somehow possible to add the sub-group of a cetrain group the address is assigned to the html output?
In the template I have ###MAINGROUP### and ###GROUPLIST###. I can't use maingroup, cause it's not the case that the group I need is always the maingroup. And with the grouplist I can't say which group is the sub-group of the one group.
Anyone have an idea how I could do it?
And in addition to that I also need the value of a self created field in the tt_address table.
Edit:
I try it like #lorenz say. What I have so far:
ext_localconf.php:
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_address']['extraItemMarkerHook'][]
='EXT:txnextaddresssort/class.tx_next_address_sort_addmarkers.php:tx_next_address_sort_addmarkers';
class.tx_next_address_sort_addmarkers.php:
<?php
class tx_next_address_sort_addmarkers {
function extraItemMarkerProcessor(&$markerArray, &$address, &$lConf,
&$pObj) {
$lcObj = t3lib_div::makeInstance('tslib_cObj');
$lcObj->data = $address;
$markerArray['###SORTBEREICH###'] =
$lcObj->stdWrap($address['tx_nextaddresssort_sort_bereich'],
$lConf['tx_nextaddresssort_sort_bereich.']);
}
}
Extentionkey: next_address_sort
All I get is a blank screen, but no errors in apache log
No, there is no possibility to do that.
Yet you can write a custom extension that integrates the extraItemMarkerProcessorhook in tt_address. In ext_localconf.php, add:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_address']['extraItemMarkerHook'][] ='EXT:myextension/class.tx_myextension_filename.php:tx_myextension_classname';
Then add a file class.tx_myextension_filename.php to your extension.:
class tx_myextension_classname {
public function extraItemMarkerProcessor(&$markerArray, &$address, &$lConf, &$pObj) {
$lcObj = t3lib_div::makeInstance('tslib_cObj');
$lcObj->data = $address;
$markerArray['###MYFIELD###'] = $lcObj->stdWrap($address['myfieldlikeindatabase'], $lConf['myfieldlikeindatabase.']);
return $markerArray;
}
}
This would be an example for getting a field that is in the tt_address table and adding it to the markers so they can be used in a template. It is also stdWrap enabled.
Now, instead of getting a field, you should replace $address['myfieldlikeindatabase'] with a variable that contains the information you need. To receive the data, you can use the TYPO3 database API functions ($GLOBALS['TYPO3_DB']).

Raphael.js : how to unset Element's attr?

I have a link set to Element:
element.attr({href: 'http://google.com'});
Now I want to delete a link. I'm trying:
element.attr({href: false});
element.attr({href: null});
element.attr({href: ''});
But none of them works.
Even
delete element.attrs.href;
doesn't help.
How can I unset element's attribute?
you should be aware that (using Raphaël API,) .attr() does not affect the underlying DOM element, but merely attaches a property to the Raphaël object.
if you wish to address the actual node's href attribute you should either use:
element.node.href = 'http://google.com';
or:
element.node.setAttribute('href', 'http://google.com');
Check out 'Element.node' on the Raphaël's documentation.

add DatiTime to DateTime, doctrine 2 not see changes

I have some action where need update DateTime property. I wrote
public function foo()
{
$this->completionTime = $this->completionTime->add(new \DateInterval('P1W'));
}
property completionTime successful updated in object, but doctrine don't see changes and don't save this.
When I update some other property, doctrine save this property, but completionTime not save again.
Also I write $this->compleationTime = new \DateTime('now') property updated and saved normal.
Any ideas?
Now I have this code, it's work, but...
$time = $this->completionTime->getTimestamp() + 3600 * 24 * 7;
$this->completionTime = new \DateTime(date(DATE_ATOM, $time), new \DateTimeZone('Europe/Kiev'));
In doctrine2 documentation, dates are detected by reference (source).
$this->completionTime = clone $this->completionTime;
$this->completionTime->add(...)
The above snippet should work.

Subsonic not setting IsLoaded on Add?

if dupe question sorry tight deadline and didn't find right away.
Seems when I add a new record via Subsonic v3 it does get added but then when I try to update a value the update doesn't happen as the _isLoaded is false.
user.username = "batman";
user.Add();
address.address1 = "1234 Anyhwere St";
address.Add();
user.AddressID = address.ID;
user.Update();
The AddressID of the user iActiveRecord never gets updateded as it seems the _isLoaded wasn't true at the time of the AddressID setter property.
Am I missing something? Please advise.
The way I got this to where it would update after an add is manually using the 'SetIsLoaded' method on the activerecord class
user.Add();
user.SetIsLoaded(true);
user.AddressID = address.ID;
user.Update();
Seems kinda smelly to me, but it does work.