This one is a estrange error that seems to be only happening in one of my D7 sites, which leads me to believe it could be either:

- An install of this module that went wrong and somehow it did not uninstall properly. I did try uninstalling and reinstalling with no luck.
- Some other module is creating a incompatibility, but I can't seem to figure out which.

The error occurs when trying to access the profiler builder page in the administration:

Recoverable fatal error: Object of class stdClass could not be converted to string in _profiler_builder_info_file() (line 144 of /Users/cliris/Sites/drupal7/sites/all/modules/contrib/profiler_builder/profiler_builder.module). 

Error
The website encountered an unexpected error. Please try again later.

The module works just fine in the other multisite installs, all of them running the latest D7 version.

Any hints at what should I'll be looking for? The log shows no errors neither.

I am baffled by this one.

screenshot attached.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markwk’s picture

@kannary100: Seems a bit baffling too, especially something like a fatal error. This module doesn't do a whole lot. Just a couple database queries.

1.) I'm also not sure about an install/uninstall issue since this module doesn't really install anything :-)

2.) Compatibility-wise I'm not sure. What modules are you running?

3rdLOF’s picture

A lot.....More like what modules I am not running.

I am doing a cross-comparison to see what is up....

I am also looking into path issues with the "profiler" library.

markwk’s picture

Status: Active » Postponed (maintainer needs more info)

@kannary100: I haven't tested this outside of a relatively normal range of modules, all well-used and maintained.

3rdLOF’s picture

Nothing.

EVEN disabling all the modules, for whatever reason, the error stands as stubborn as a rock. I even re-downloaded both profiler and this module, upgraded Drupal 7 to dev....Nothing.

I can find plenty of cases on Drupal where this sort of error has happened, but so far I see no consistency between them other than it appears somehow the object is being read as a string.

For a moment I though I had a lead on this being because I am using 5.2 PHP, but....all the other sites are also running the same without problems.

Then I thought (based on some reference someone made about sessions) that maybe a corrupt session cookie or some old script stuck in cache: Clearing did nothing.

Then I re-read your comment and disable and uninstalled three modules that were active but unmaintained.

Nothing, The error stands.

markwk’s picture

So can you just disable this module?

I'm a little confused about when this error started? You enabled the module and it started then?

axe312’s picture

Had the same error. The problem is, that $val may be an object.

In my case, $val is an object at a language variable. I have l10n_update enabled, maybe this module causes the conflict!

This may help you fix the error:

if(is_object($val)){
    ob_start();
    var_dump($val);
    $val = ob_get_clean();
}
$vars.= 'variables['. $value->name .'] = '. $val ."\n";

greetings

markwk’s picture

@axe312: thanks! I wonder if the same error/conflict occurs in 6.x too.

@kannary100: does this fix your problem?

eme’s picture

The code above fixes the issue indeed.

3rdLOF’s picture

Thank you.

That solved the problem for me as well.

markwk’s picture

Ok. Good to hear. I actually haven't looked at the code and not quite sure how to test? I'm super busy these days since a teaching website I run just recently got blocked inside of China with lots of students and teachers wondering... if someone posts a patch, I'll add ASAP. Otherwise it'll be some time...

axe312’s picture

My code will NOT fix the problem itself!

Its only a small workaround who avoids the error message and dumps the object. I'am sure it will result in an invalid .info-file.

RKS’s picture

Can someone tell me where you put that code? I have the same error but no multilanguage site.

RKS’s picture

Nevermind. Replace line 144, duh.

markwk’s picture

@RKS: It's an issue with objects, not quite sure what proper way to handle this is yet.

axe312’s picture

markwk: You should contact the developer of the profiler module and ask him how objects should be handled.
Maybe its possible to serialize them or transform in a json object. I think for this the profiler module must be adapted.

markwk’s picture

Title: Odd Fatal Error with partial WOD, but only in one install of D7. » Fix so Objects are Properly Handled
Status: Postponed (maintainer needs more info) » Active

@axe312: good idea. I changed to the Issue to Reflect the real Problem.

bisonbleu’s picture

Indeed, it does happen in 6.x for a multilingual website (i18n). First error happens 3 times. The second error only once.

  • /my_site.com/sites/all/modules/profiler_builder/profiler_builder.module on line 139.
  • recoverable fatal error: Object of class stdClass could not be converted to string in /home/five6aff/public_html/my_site.com/sites/all/modules/profiler_builder/profiler_builder.module on line 144.
torsti’s picture

I think it's not i18n which only conflicts with this module. I tested this with different settings:

1. Basic Drupal 7.12 install
- only one language (english)
- core Locale module installed
- i18n not installed
= no problems

If I do any changes to language settings (admin/config/regional/language) e.g. change language weight or default language, it throws error at Profiler Builder settings page (admin/config/development/profiler_builder).

2. Drupal 7.12 install based on custom install profile
- two languages (english & finnish, which is default)
- core Locale module installed
- i18n not installed
= error at Profiler Builder settings page

Recoverable fatal error: Object of class stdClass could not be converted to string in _profiler_builder_info_file() (line 149 of /var/aegir/platforms/drupal-7.12/sites/all/modules/profiler_builder/profiler_builder.module).
The website encountered an unexpected error. Please try again later.

ladyofthelake’s picture

Is there any chance to get this working?

btopro’s picture

will accept patches to get this functionality in; I haven't done work on the 7.x branch (yet) and markwk that started the 7x has since moved on from this project (to the best of my knowledge). If profiler supports objects then we could look into it, I will need this at some point, though patches will speed this up dramatically.

markwk’s picture

btopro is right. I don't really have any immediate plans to continue working on this. It's definitely a useful little module for getting an installation profile put together initially. Since I'm not building any distros recently, I haven't used it all. It'd be interested to see if any of the Drupal 7 distros (perhaps eventual Drupal Commons) might be interested in getting this done. Might be an idea to post something in one of their issue queues.

KarenS’s picture

Status: Active » Needs review
FileSize
0 bytes

The error happens if there are any variables that are storing objects instead of arrays. I'm not sure variables ought to be storing objects in the first place, so they may even be mistakes or bugs. The following patch will keep things from blowing up by skipping any such variables and display a message to indicate that this variable was skipped so it can be investigated and either fixed or added manually.

KarenS’s picture

FileSize
779 bytes

This time with a patch :)

torsti’s picture

Thanks Karen. I applied the patch, but unfortunately I'm getting the same error as before (#18):

Recoverable fatal error: Object of class stdClass could not be converted to string in _profiler_builder_info_file() (line 152 of /var/aegir/platforms/drupal-7.14/sites/all/modules/profiler_builder/profiler_builder.module).
The website encountered an unexpected error. Please try again later.
KarenS’s picture

Try this one. There are two different levels where it could encounter an object and I only fixed one of them.

torsti’s picture

That did it - no more errors. Thanks Karen!

markwk’s picture

Thanks for the contribution KarenS. I'm starting a new project with multiple languages this week so perfect chance to pick up profiler_builder again and test your patch.

btopro’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev

need a reroll of patch if this is still an issue

btopro’s picture

Status: Needs review » Fixed

Ok, I modified the original patch a bit as a reroll against the latest dev. Objects cause issues with some other modules as well as language values. If you need these variables to be exported the recommended method is to use Features to capture these http://drupalcode.org/project/profiler_builder.git/blobdiff/cb36495920a7...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.