Closed silverstripesk closed 3 years ago
Thank you for the report. You're right, those trailing commas are not necessary and not supported in php 7.1/7.2. I've fixed it in 94045ca2a7d9bad71898a37690f92b57bd712266 and released it as v1.0.1. After you update, it should now work.
@silverstripesk oh, sorry, I've only skimmed your post and thought the 2nd part was just error messages. I've completely missed half of your message.
I've now pushed a second update that also fixes the template issue in e60fba14cc0fb9cdd5d28020736905e453523a55 and released it as v1.0.2. Could you please update and let me know if it's working now?
@silverstripesk You also have to update your template code, please see the updated README.md
Hi Zauberfisch,
looks like excellent module, but isn't working for me (php 7.2, ss 4.7):
1) dev/build is throwing error after installation:
Parse error: syntax error, unexpected ')' in /.../vendor/zauberfisch/silverstripe-easy-linkfield/src/Link/PhoneLink.php on line 31
I fixed it by simply removing unneeded commas.
After this fix is backend working nicely.
2) But frontend throws another error:
[Emergency] Uncaught Exception: Could not find field 'Link'. GET /tim/detail/emil-horvath?flush Line 138 in /.../vendor/zauberfisch/silverstripe-serialized-dataobject/src/AbstractDataObject.php
I am using this template: `<% loop $Links.getValue %>
This is model:
use zauberfisch\LinkField\LinkListField; use zauberfisch\LinkField\DBLinkList; class MaxTeamMember extends DataObject { private static $singular_name = 'Team member'; private static $plural_name = 'Team members'; private static $db = [ 'Links' => DBLinkList::class ]; public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', LinkListField::create('Links', 'Užitočné odkazy')->setOrderable(true)); return $fields; } }
This is stored in DB:
{"items":[{"fieldsData":{"Title":"example.com","URL":"https:\/\/example.com"},"listsData":[],"#type":"zauberfisch\\LinkField\\Link\\ExternalLink"}],"#type":"zauberfisch\\SerializedDataObject\\ArrayList"}
Regards
Pali