Jump to content


These Forums Are Now Read-Only


For TubePress support, please post a question here or open a support ticket and we will be glad to assist.


Photo

Fatal error ComponentReflector.class.php


  • Please log in to reply
15 replies to this topic

#1 Eric Gillis

Eric Gillis

    Member

  • Members
  • PipPip
  • 10 posts

Posted 31 December 2010 - 10:01 AM

Wordpress 3.0.4, Tubepress Pro 2.1.2

When activating the plugin, I receive this error:

Parse error: syntax error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in /netapp/whnas-silo1-node2/s7/s7/01062/www.packetiq.com/webdocs/wp-content/plugins/tubepress_pro_2_1_2/classes/net/sourceforge/phpcrafty/ComponentReflector.class.php on line 45


All plugins are deactivated. Unable to move any further. Anyone?

#2 Eric Gillis

Eric Gillis

    Member

  • Members
  • PipPip
  • 10 posts

Posted 31 December 2010 - 10:27 AM

I have confirmed that I'm using PHP Version 5.0.5. The published requirement is v. 5.0.2.

I would appreciate any help on this.

#3 Eric Gillis

Eric Gillis

    Member

  • Members
  • PipPip
  • 10 posts

Posted 31 December 2010 - 11:14 AM

Here are lines 40 to 56 encompassing the code snippet. Line 45 begins after the closing comment tag.


/**
   * Create an instance with the given array of arguments in the constructor.
   * @param mixed[] $args
   * @return object
   */
  public function newInstanceArgs(array $args = array())
  {
      $o = parent::newInstance();
    
    foreach ($this->_properties as $k => $v)
    {
      $setter = 'set' . ucfirst($k);
      $this->getMethod($setter)->invoke($o, $v);
    }
    
    return $o;
  }


#4 Eric Gillis

Eric Gillis

    Member

  • Members
  • PipPip
  • 10 posts

Posted 31 December 2010 - 11:18 AM

Here's the full phpinfo:

http://packetiq.com/phpinfo.php

#5 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 31 December 2010 - 07:44 PM

Hi,

I'm sorry (and a bit embarrassed) that this bug seems to have slipped through the cracks. The good news is that the solution should be simple; just remove the "array" keyword. So you'll change that line from

public function newInstanceArgs(array $args = array())
to

public function newInstanceArgs($args = array())
Also good news is that this section of the code will be entirely replaced with a more robust mechanism in the next release of WordPress.

Let us know if that fixes it for you. Again sorry for the inconvenience and misstep on my part.

#6 Eric Gillis

Eric Gillis

    Member

  • Members
  • PipPip
  • 10 posts

Posted 03 January 2011 - 02:59 PM

Thank you Eric. The plugin activates now without the error; however I have another problem:

My widgets page does not seem to load completely. The "Available Widgets" panel loads, but not the "Inactive Widgets" or any of my sidebars. When I deactivate the plugin, the problem is corrected.

Is this another issue with which you can provide help? Thanks.

#7 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 03 January 2011 - 10:03 PM

That's bizarre indeed. What does your PHP error log show? Sounds like the page isn't loading completely, in which case there's almost certainly a log entry explaining what happened. Another option would be to put WordPress into debug mode: http://fuelyourcodin...gg...wordpress/

#8 Eric Gillis

Eric Gillis

    Member

  • Members
  • PipPip
  • 10 posts

Posted 11 January 2011 - 10:20 PM

Eric, here the error in the log:

PHP Fatal error: Class 'org_tubepress_ioc_ContainerAware' not found in /netapp/whnas-silo1-node2/s7/s7/01062/www.packetiq.com/webdocs/wp-content/plugins/tubepress_pro_2_1_2/classes/net/sourceforge/phpcrafty/ComponentFactory.class.php on line 205

#9 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 14 January 2011 - 07:22 PM

Well you definitely have a knack for flushing out bugs in TubePress Pro! This appears to be a remnant of an old class that is no longer a part of TubePress. The good news is that both bugs that you've found/reported are in some 3rd-party code that will be completely swapped out in the next version of TubePress. In the meantime, to get you going, you can just comment out the offending lines from /netapp/whnas-silo1-node2/s7/s7/01062/www.packetiq.com/webdocs/wp-content/plugins/tubepress_pro_2_1_2/classes/net/sourceforge/phpcrafty/ComponentFactory.class.php. So change

if ($o instanceof org_tubepress_ioc_ContainerAware) {    $o->setContainer($this);}
to

//if ($o instanceof org_tubepress_ioc_ContainerAware) {    //$o->setContainer($this);//}
Again I'm very sorry for these bugs and now very embarrassed that they weren't taken care of. We will get you squared away, that I can promise. Thanks.

#10 Eric Gillis

Eric Gillis

    Member

  • Members
  • PipPip
  • 10 posts

Posted 17 January 2011 - 11:26 AM

Eric, this seems to have resolved the issue. Thanks for the help and great support. I look forward to using your plugin and recommending to others.

#11 Eric Gillis

Eric Gillis

    Member

  • Members
  • PipPip
  • 10 posts

Posted 18 January 2011 - 01:02 PM

OK, after applying your fix, everything seems to be operating in the admin just fine; however I'm now getting more errors when I implement on the front end. Here it is:

PHP Fatal error: Call to a member function getAttribute() on a non-object in /netapp/whnas-silo1-node2/s7/s7/01062/www.packetiq.com/webdocs/wp-content/plugins/tubepress_pro_2_1_2/classes/org/tubepress/video/factory/impl/YouTubeVideoFactory.class.php on line 254

And here's the code for lines 251 through 255:
private function _getDuration()
    {
       $duration = $this->_xpath->query('media:group/yt:duration', $this->_currentNode)->item(0);
       return org_tubepress_util_TimeUtils::secondsToHumanTime($duration->getAttribute('seconds'));
    }

Thanks again for your help on this.

#12 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 19 January 2011 - 01:01 PM

That's strange. Seems like YouTube returned a video without a duration/length. I'd like to try to reproduce the issue locally. Can you tell me what shortcode you're using? Or what user/playlist/search I could implement to see the issue? Thanks..

#13 Eric Gillis

Eric Gillis

    Member

  • Members
  • PipPip
  • 10 posts

Posted 19 January 2011 - 01:14 PM

Actually, nothing was returned at all. The frontend page that had the plain [tubepress] shortcode would not finish loading, and the above was the error I extracted from the log.

#14 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 19 January 2011 - 01:59 PM

OK, could you tell me what you have selected under WP Admin > Settings > TubePress > Which Videos? That should allow me to reproduce the issue locally and figure out what the problem is. Thanks!

#15 Eric Gillis

Eric Gillis

    Member

  • Members
  • PipPip
  • 10 posts

Posted 19 January 2011 - 06:16 PM

Videos from this YouTube user: solarwindsinc

shortcode keyword: video

shortcode on page: [video]

#16 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 19 January 2011 - 10:02 PM

I just tested this locally and was able to pull up a gallery without the error: http://i.imgur.com/m4ZQ1.png Are you able to use TubePress for other galleries? For instance, are you able to display a gallery for YouTube's "featured" videos? What about videos uploaded by other YouTube users?

None of the "patches" that we applied earlier in this thread should affect the display of videos, so I admit I'm stumped for the moment.