Getting DataObject Error

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

Hi There

Need assistance with this error (see attached image).

Am creating Tabs option along with the main content on my page template, however, it’s giving me:

# Declaration of Tabs::canCreate($member = NULL) should be compatible with SilverStripe\ORM\DataObject::canCreate($member = NULL, $context = Array)


Tabs%20Add

Hard to be sure without seeing your actual code, but the error suggests that you’ve created a canCreate() method which has a different configuration to one which it’s overwriting. Is this your own code, or a module? Does the Tabs::canCreate() method have two arguments as shown in the error?

1 Like

I was getting this error in dev mode. So once I removed that, it worked fine.

Once you took the site out of dev mode, it just stopped showing you the warning… unless you’ve changed the code, then the issue is still there :wink:

Granted, it’s just a warning, so it’s not too dramatic, but the fix should be fairly easy.

1 Like