<p>That's interesting Luke, I had the exact same issue and spent WAY too long on it.</p>

<p>Even though I used a diff tool to see the difference between working elementType models and the one with the error I just did not catch the silly difference:</p>

<pre><code>protected function defineAttributes()
{
    return array(
</code></pre>

<p>vs the working:</p>

<pre><code>protected function defineAttributes()
{
    return array_merge(parent::defineAttributes(), array(
</code></pre>

<p>you need to add the parent attributes that includes attributes like locale :)</p>

<p>I knew that all along, but just didn't catch it on multiple re-reviewing of the Model.</p>

CC BY-SA 3.0
2015-02-04T04:47:21.130Z
lol - it's a good thing you were here to help answer the question.
Brad Bell
CC BY-SA 3.0
2015-02-04T04:52:21.737Z
I was the hero l needed, not the one I deserved.
Luke Holder
CC BY-SA 3.0
2015-02-04T07:26:34.957Z
Luke, I heard Luke also had this issue.  Maybe you should ping him! =)
Ben Parizek
CC BY-SA 3.0
2015-02-04T07:29:26.943Z
thought this might be helpful @LukeHolder
Luke Holder
CC BY-SA 3.0
2015-02-04T04:23:14.937Z
2015-02-04T04:23:14.937Z
Luke Holder
<p>I have made numerous elementTypes in my plugin that all work perfectly but for some reason one elementType keeps having an error when trying to view the Model's content or custom fields.</p>

<p>This is the error:</p>

<p><code>Property "Craft\Myplugin_OrderModel.locale" is not defined.</code></p>

<p>Everything looks exactly the same as all the other models that are elementTypes in my plugin.</p>

<p>All my plugins elementType models are using </p>

<pre><code>public function isLocalized()
{
    return false;
}
</code></pre>

<p>but the issue still persists with that one Model.</p>

<plugin-development><elementtype><baseelementmodel>
Why does my custom element type error around locale being missing on the element types' model?
# Why does my custom element type error around locale being missing on the element types' model?

(Asked by: username_0 on 2015-02-04)

I have made numerous elementTypes in my plugin that all work perfectly but for some reason one elementType keeps having an error when trying to view the Model's content or custom fields.
This is the error:
Property "Craft\Myplugin_OrderModel.locale" is not defined.
Everything looks exactly the same as all the other models that are elementTypes in my plugin.
All my plugins elementType models are using 
public function isLocalized()
{
    return false;
}

but the issue still persists with that one Model.

**Tags:** plugin-development, elementtype, baseelementmodel

---

## 1 answers

### Answer by username_0 on 2015-02-04. Score: 3

That's interesting Luke, I had the exact same issue and spent WAY too long on it.
Even though I used a diff tool to see the difference between working elementType models and the one with the error I just did not catch the silly difference:
protected function defineAttributes()
{
    return array(

vs the working:
protected function defineAttributes()
{
    return array_merge(parent::defineAttributes(), array(

you need to add the parent attributes that includes attributes like locale :)
I knew that all along, but just didn't catch it on multiple re-reviewing of the Model.

> **Comments:**
> **username_1**: lol - it's a good thing you were here to help answer the question.  
> **username_0**: I was the hero l needed, not the one I deserved.  
> **username_2**: Luke, I heard Luke also had this issue.  Maybe you should ping him! =)  
> **username_0**: thought this might be helpful @LukeHolder  

---

