Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[QueryInheritanceBuilder.php] - Incorrect column peer name when using model prefix #542

Closed
johnson-was opened this Issue · 2 comments

2 participants

@johnson-was

Example bad code generated

$this->addUsingAlias(AssetPeer::TYPE_ID, Model_AssetPeer::CLASSKEY_2);

Suggested fix

line 263
--- a/PropelORM-1.6.7/generator/lib/builder/om/QueryInheritanceBuilder.php
+++ b/PropelORM-1.6.7/generator/lib/builder/om/QueryInheritanceBuilder.php
@@ -260,7 +260,7 @@ class "  .$this->getClassname() . " extends " . $baseClassname . " {
         $child = $this->getChild();
         $col = $child->getColumn();

-        return "\$this->addUsingAlias(" . $col->getConstantName() . ", " . $this->getPeerClassname()."::CLASSKEY_".strtoupper($child->getKey()).");";
+        return "\$this->addUsingAlias(" . $this->getColumnConstant($col) . ", " . $this->getPeerClassname()."::CLASSKEY_".strtoupper($child->getKey()).");";
     }

     protected function addDoDeleteAll(&$script)
@johnson-was

Thanks for the quick response William.

@willdurand
Owner
@havvg havvg referenced this issue from a commit in Ormigo/Propel
@havvg havvg Merge branch 'master' into ormigo
* master:
  Fixes #345
  Allow the QuickGenerator to use another Platform
  Change fallback order in getTableByPhpName(). Fixes #385
  Fix initialization of internal iterator for getRelCol. fix #460
  Add a test for initialization of internal iterator for related object collection getter fix #460
  Fix PR #544
  teaching propel to clear UP and DOWN when calling clearAllReferences(true) we have infinite recursion prevention already covered also we add an optional param to clearInstancePool. if passes as true it will clearAllReferences(true) on every instance before clearing it.
  Fix CS
  Fix cast in setters. Should fix #283
  Fix inconsistency for BIGINT. Fixes #459
  Use model prefix in QueryInheritanceBuilder, fixes #542
  fix variable name on boolean filter methods
  Tests for improved ENUM handling
  Improved getValueSet() method, added ENUM getters for SQL value, set Query filter to use SQL getters
  Add PHP 5.5 to travis config
  Update generator/lib/builder/om/PHP5PeerBuilder.php
  sqlType="enum(..)" now set the valueSet attribute it is not required to use Propel::ENUM as type
7d94f67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.