Hi,

I am in the process of trying this out but I keep getting this error message:

"Strict warning: Declaration of SparqlViewsResource::view() should be compatible with that of Entity::..."

And then, I am not in a position of creating the view afterwards. I looked up at my modules list and it appears okay as i have installed the correct versions of entity API, RDFx modules and sparql api...
So, I was wondering if anyone had problem with that as well....
I am currently trying this out on a localhost but i am not sure this would be related to the above...
Anyway, any help would be more than appreciated.
Thanks
T

Comments

Anonymous’s picture

Status: Active » Postponed (maintainer needs more info)

This is most likely an issue with a change in Entity API.

If this is the case, if you switch to Entity API beta-9, the warning would go away. Please let me know if you try this what the results are.

jaypark’s picture

Lin, running Entity API 7.x-1.0-rc1 and getting the same warning with sparql_views 7.x-2.0-beta1 after enabling sparql_views; this is the first version of sparql_views installed|enabled.

Anonymous’s picture

Please try with Entity API beta9

jaypark’s picture

>git rm -r sites/all/modules/entity
>drush dl entity

http://localhost/update.php
(no db updates for entity reversion)

Strict warning: Declaration of sparql_views_plugin_query_sparql::query() should be compatible with that of views_plugin_query::query() in require_once() (line 5 of C:\xampp\htdocs\sites\all\modules\sparql_views\plugins\sparql_views_plugin_query_sparql.inc).

Anonymous’s picture

Right, if you run that command you will get the release candidate rc1.

The beta came before the release candidate. I'm wondering if you could test with that to see whether the error comes from a change between beta9 and rc1 or whether it is something else that is affecting both your systems.

jaypark’s picture

Lin, same message with beta9 O.O

Anonymous’s picture

And just to be sure, does this warning only pop up when you are creating the view?

jaypark’s picture

Nope. I didn't notice it until I checked watchdog after an error when I walked through the IBM drupal+rdfx+sparql tutorial. I'd noticed this warning was logged quite a few times, many more times than SPiews (SPARQL views - may I?) were created. Apologies for late response.

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Active

Oh, I didn't realize it was being logged to watchdog, I thought it was being output to the screen from the original report. I haven't tested, but this sounds like a sensible explanation for why I wasn't seeing it, so moving this back to active. Thanks.

cutmedia’s picture

Getting the same warning on all pages (output to screen) with both versions of the Entity module as stated above:
Strict warning: Declaration of SparqlViewsResource::view() should be compatible with that of Entity::view() in include_once() (line 250 of C:\xampp\htdocs\test\sites\all\modules\sparql_views\sparql_views.module).

Anonymous’s picture

Title: error message pops up when creating a view » Strict warning: Declaration of SparqlViewsResource::view()
Status: Active » Closed (cannot reproduce)

I'm using the dev version of SPARQL Views with the latest rc of Entity API, and I simply can't reproduce this bug, which is strange since it's happening for multiple people. I wonder if some people might have been using the beta.

If you are certain that you are using SPARQL Views latest dev, and have flushed your caches and have run update.php, and are still getting this message, move back to active.

pjverbruggen’s picture

I also had this Strict Warning and I was using Sparql_Views 7.x-2.0-beta1+11-dev and Entity API 7.x-1.0-rc2.
Now I use Sparql_Views 7.x-2.0-beta1+11-dev and Entity API 7.x-1.0-beta9 and the warning is gone.

(Off-topic: many thanks to Lin Clark, I was following your tutorial about sparql views, really love it!)

mropanen’s picture

I had this problem (the one in the original post about SparqlViewsResource::view(), the query one is still present) with the latest dev of SPARQL Views and Entity API rc3.

Since entity.inc's function view($view_mode = 'full', $langcode = NULL, $page = NULL) expects a $page parameter, I added that to sparql_views.module's implementation, so that it is now

public function view($view_mode = 'full', $langcode = NULL, $page = NULL) {
  $view =  parent::view($view_mode, $langcode, $page);

EDIT.

The one about function query($view, $get_count = FALSE) in sparql_views_plugin_query_sparql.inc was solved by removing the $view parameter which is not used at least anymore in Views 7.x-3.5 plugins.

netw3rker’s picture

Status: Closed (cannot reproduce) » Active

here's the answer. PHP 5.2.x doesn't care about incompatible declarations, however php 5.3.x and higher does and it throws an E_STRICT when it encounters a definition that has a different set of arguments that the declaration. (assuming that you have php.ini configured to be strict about syntax) LIN, this is most likely why you are not able to reproduce this error.

That being said, I'm running into the same error - on PHP 5.3 - and mropanen's fix solved the problem. This is clearly an issue with the continuing evolution of the entity module and this declaration should follow suit.

Hope this helps!

netw3rker’s picture

StatusFileSize
new1.05 KB

patch for both function fixes attached

netw3rker’s picture

Status: Active » Needs review
jneubert’s picture

Had the same issue under php 5.4.4. #15 worked perfectly for me.

jneubert’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
daemonchrist’s picture

Status: Reviewed & tested by the community » Needs work

The patch in #15 causes SPARQL views to produce no results. This is because all the calls to the query function need to be changed to single argument as well. Otherwise, the $view object gets passed to the $get_count parameter, which evaluates to TRUE in boolean. You can see this if you look at the query in Views preview: it always says SELECT(COUNT(?field1 ?field2 ...)) instead of SELECT ?field1 ?field2 ... etc. and the results are always empty.

JGoldsmith’s picture

Hi, I can confirm with #19 that this is still an issue.

strict warning: Declaration of SparqlViewsResource::view() should be compatible with Entity::view($view_mode = 'full', $langcode = NULL, $page = NULL) in include_once() (line 250 of /home/user/public_html/drupal-catam/sites/all/modules/sparql_views/sparql_views.module).

daemonchrist’s picture

Status: Needs work » Needs review
StatusFileSize
new488 bytes

I trimmed down the patch from #15 to just fix this bug. Let's deal with the query() function separately in bug #1873422: Strict warning: Declaration of sparql_views_handler_argument::query() should be compatible with that of views_handler_argument::query()