Yii Framework Forum: Upgrade Dalla 1.1.12 Alla 1.1.13 - L'alias 't' È Deprecato ? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Upgrade Dalla 1.1.12 Alla 1.1.13 - L'alias 't' È Deprecato ? Rate Topic: -----

#1 User is offline   realtebo 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 700
  • Joined: 03-October 12
  • Location:Ferrara

Posted 21 January 2013 - 04:49 AM

Faccio riferimento a questa pagina: Istruzioni per l'upgrade

Qui si legge, tra le altre cose:

Quote


- Criteria modification in CActiveRecord::beforeFind() did not apply to the query when model was loaded in a relational context.
Since version 1.1.13 changes to query criteria made in beforeFind() now also apply to the query when model is loaded in a relational context.
The main problem here is that you can not use the `t`-alias for your table anymore, you have to change your code to
use the table alias currently in use as this is different in relational context.
You can get that alias by calling `$this->getTableAlias();` in your active record class
or `$this->owner->getTableAlias()` in behavior context.

Example:
$criteria->condition = 't.myfield = 1';
You need to change that to:
$alias = $this->owner->getTableAlias();
$criteria->condition = $alias.'.myfield = 1';



Mi potete chiarire quanto grave è questa cosa ? Ovviamente ho parecchie query in giro per il codice che usano 't.' come alias.

Ma non ho NESSUNA implementazione della beforeFind.

Devo preoccuparmi? Perchè attualmente l'intera applicazione funziona a meraviglia e quindi credo di NON averne capito il contesto ...
Il computer non ragiona, ma ha sempre ragione.
Ricordalo quando fai il debug
0

#2 User is offline   sensorario 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,987
  • Joined: 07-September 10
  • Location:Cesena (Italy)

Posted 25 January 2013 - 04:38 PM

Se hai testato il tuo sito, non devi preoccuparti di nulla.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users