# Nach update auf Version 5.6 - getAttribute funktioniert nicht mehr

**URL:** <https://forum.shopware.com/t/nach-update-auf-version-5-6-getattribute-funktioniert-nicht-mehr/63530>\
**Category:** Programmierung\
**Created:** [13. Dezember 2019 um 11:07 UTC](https://forum.shopware.com/t/nach-update-auf-version-5-6-getattribute-funktioniert-nicht-mehr/63530 "2019-12-13T11:07:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![payfactory](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@payfactory](https://forum.shopware.com/u/payfactory)\
**Post date:** [13. Dezember 2019 um 11:07 UTC](https://forum.shopware.com/t/nach-update-auf-version-5-6-getattribute-funktioniert-nicht-mehr/63530/1 "2019-12-13T11:07:41Z")

</div>

Vieleicht kann mir jemand helfen, die Fuktion getAttribute funktioniert so nicht mehr, danke!

&nbsp;

&nbsp;private function checkIfParentArticleNeedsLicense($parentArticle)  
&nbsp; &nbsp; {  
&nbsp; &nbsp; &nbsp; &nbsp; $em = $this-\>container-\>get(‘models’);  
&nbsp; &nbsp; &nbsp; &nbsp; $articleID = Shopware()-\>Modules()-\>Articles()-\>sGetArticleIdByOrderNumber($parentArticle);  
&nbsp; &nbsp; &nbsp; &nbsp; $article = $em-\>getRepository(Article::class)-\>findOneBy([‘id’ =\> $articleID]);  
&nbsp; &nbsp; &nbsp; &nbsp; $articleAttributes = $article-\> **getAttribute** ()-\>getislicensearticle();  
&nbsp; &nbsp; &nbsp; &nbsp; return $articleAttributes;

---

<div class="post-metadata">

**Author:** ![shyim](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/shyim/32/7681_2.png) [@shyim](https://forum.shopware.com/u/shyim)\
**Post date:** [15. Dezember 2019 um 18:11 UTC](https://forum.shopware.com/t/nach-update-auf-version-5-6-getattribute-funktioniert-nicht-mehr/63530/2 "2019-12-15T18:11:54Z")

</div>

getAttribute gibt es nicht mehr am Artikel

Du musst -\>getMainDetail()-\>getAttribute machen

---

<div class="post-metadata">

**Author:** ![payfactory](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@payfactory](https://forum.shopware.com/u/payfactory)\
**Post date:** [15. Dezember 2019 um 19:52 UTC](https://forum.shopware.com/t/nach-update-auf-version-5-6-getattribute-funktioniert-nicht-mehr/63530/3 "2019-12-15T19:52:44Z")

</div>

Hallo Shyim,

vielen Dank, jetzt kommt ein anderer Fehler?&nbsp;

use \Shopware\Models\Article\Article;

class Shopware\_Controllers\_Frontend\_ParentChildDecisionPage extends \Enlight\_Controller\_Action  
{

&nbsp; &nbsp; private function checkIfParentArticleNeedsLicense($parentArticle)  
&nbsp; &nbsp; {  
&nbsp; &nbsp; &nbsp; &nbsp; $em = $this-\>container-\>get(‘models’);  
&nbsp; &nbsp; &nbsp; &nbsp; $articleID = Shopware()-\>Modules()-\>Articles()-\>sGetArticleIdByOrderNumber($parentArticle);  
&nbsp; &nbsp; &nbsp; &nbsp; $article = $em-\>getRepository(Article::class)-\>findOneBy([‘id’ =\> $articleID]);  
&nbsp; &nbsp; &nbsp; &nbsp; $articleAttributes = $article-\>**getMainDetail()-\>getAttribute**-\>**getislicensearticle();**  
&nbsp; &nbsp; &nbsp; &nbsp; return $articleAttributes;  
&nbsp; &nbsp; }

**Fehler:**   
**Fatal error** : Uncaught Error: Call to a member function **getislicensearticle() on null in** /home/denyukdy/www.dentoo.com/testserver/custom/plugins/TMFPluginParentChildConnection/Controllers/Frontend/ParentChildDecisionPage.php:19 Stack trace: #0 /home/denyukdy/www.dentoo.com/testserver/custom/plugins/TMFPluginParentChildConnection/Controllers/Frontend/ParentChildDecisionPage.php(144): Shopware\_Controllers\_Frontend\_ParentChildDecisionPage-\>checkIfParentArticleNeedsLicense(‘SW10471’) #1 /home/denyukdy/www.dentoo.com/testserver/engine/Library/Enlight/Controller/Action.php(192): Shopware\_Controllers\_Frontend\_ParentChildDecisionPage-\>indexAction() #2 /home/denyukdy/www.dentoo.com/testserver/engine/Library/Enlight/Controller/Dispatcher/Default.php(478): Enlight\_Controller\_Action-\>dispatch(‘indexAction’) #3 /home/denyukdy/www.dentoo.com/testserver/engine/Library/Enlight/Controller/Front.php(228): Enlight\_Controller\_Dispatcher\_Default-\>dispatch(Object(Enlight\_Controller\_Request\_RequestHttp), Object(Enlight\_Controller\_Response\_Respon in&nbsp; **/home/denyukdy/www.dentoo.com/testserver/custom/plugins/TMFPluginParentChildConnection/Controllers/Frontend/ParentChildDecisionPage.php** &nbsp;on line&nbsp; **19**

---

<div class="post-metadata">

**Author:** ![shyim](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/shyim/32/7681_2.png) [@shyim](https://forum.shopware.com/u/shyim)\
**Post date:** [27. Dezember 2019 um 14:21 UTC](https://forum.shopware.com/t/nach-update-auf-version-5-6-getattribute-funktioniert-nicht-mehr/63530/4 "2019-12-27T14:21:14Z")

</div>

$article-\>**getMainDetail()-\>getAttribute()**-\>**getislicensearticle()**

---

<div class="post-metadata">

**Author:** ![payfactory](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@payfactory](https://forum.shopware.com/u/payfactory)\
**Post date:** [27. Dezember 2019 um 14:32 UTC](https://forum.shopware.com/t/nach-update-auf-version-5-6-getattribute-funktioniert-nicht-mehr/63530/5 "2019-12-27T14:32:15Z")

</div>

Danke!&nbsp;
