Media import on RC1 does not appear to be working

Here is the error

root@dev:/var/www/test1# drush rim
Media queue has been generated. [success]
root@dev:/var/www/test1# drush rpm
START Processing of Media Items for drealty_listing with KEY 709046. [1 of 3] [success]
PHP Fatal error: Call to undefined method drealtyConnection::is_connected() in /var/www/test1/sites/all/modules/drealty/drealty.daemon.php on line 1167
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to undefined method drealtyConnection::is_connected() in
/var/www/test1/sites/all/modules/drealty/drealty.daemon.php, line 1167
root@dev:/var/www/test1#

Same error on cron run

CommentFileSizeAuthor
#9 2761645-9.is_connected.patch479 bytesjrb
#7 drealty-is_connected.patch590 bytesbloomt

Comments

bloomt created an issue. See original summary.

avo webworks’s picture

I also experience same error as @bloomt
PHP Fatal error: Call to undefined method drealtyConnection::is_connected() in ..sites/all/modules/drealty/drealty.daemon.php on line 1167
I can generate the queue but not process the queue. It doesn't matter if I try to process the queue via drush or via cron.
This is on a clean Drupal 7 install with 7.x-3.0-rc1 installed.

shauntyndall’s picture

Status: Active » Postponed (maintainer needs more info)

Could you clarify which version of PHP you are running and seeing this error?

bloomt’s picture

My test server runs PHP 5.5.9

I will test on other php versions and let you know if my results change.

bloomt’s picture

Do you have a recommended PHP version?

bloomt’s picture

Testing results from drush rpm

PHP version drush is running - Error message
5.3 - Error - unexpected '=', expecting ')' - Same as https://www.drupal.org/node/2765971
5.4 - Error - unexpected '=', expecting ')' - Same as https://www.drupal.org/node/2765971
5.5 - Error: Call to undefined method drealtyConnection::is_connected()
5.6 - Error: Call to undefined method drealtyConnection::is_connected()
7.0 - Error: Call to undefined method drealtyConnection::is_connected()

bloomt’s picture

StatusFileSize
new590 bytes

It seems as though the issue is that is_connected in
$this->dc->is_connected
is not defined anywhere in the file.

I assume that this is supposed to be there to assure that there is an active connection before attempting to import.

I created a patch that removes some code from the line 1167 that makes the image import work. My patch is definitely not best practice but it will most likely work for other people having issues.

avo webworks’s picture

I am also on PHP version 5.5.9.
The patch provided by @bloomt gives me a WSOD with error:
PHP Parse error: syntax error, unexpected 'protected' (T_PROTECTED) in .../drealty.daemon.php on line 1271

jrb’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new479 bytes

This bug appears to have been introduced with this commit for the work for #1951580.

http://cgit.drupalcode.org/drealty/commit/drealty.daemon.php?id=27b06c9f...

It calls is_connected(), but that method doesn't exist for drealtyConnection. I've attached a patch this just adds this as a simple method of drealtyConnection that returns the value of $this->connected. I'm guessing that's what the intention was.

avo webworks’s picture

The above patch #9 by @jrb works well. I am now able to import media both via drush and drealty import. Thank you.

notanumber6789’s picture

I can confirm patch #9 works with PHP 5.3.10-1ubuntu3.23

I encountered this bug when running rets-process-media from drush. This was the first time I ran that script because until this update, my images would download and update with my daily rets-import cron job. Since 7.x-3.0-rc1 no media is updated so I ran rets-import-media and then rets-process-media.

Can anyone explain whether something has changed with this update such that I should run both rets-import and rets-process-media to get a full listings import? Also everything is updated, even items that have not changed in MLS. I don't recall things working this way prior to 7.x-3.0-rc1, am I mistaken? Shouldn't only modified and new items be imported?

veronicaseveryn’s picture

Yes, the patch provided in #9 is what should be there.
I guess, when I was assembling the release code, this piece of code slipped away from me...

As for the changes related to this release, there have been implemented quite a few of them which changed the way we process data (with Drush and with Cron).

I will try to update README file some time soon to have everything described to eliminate confusion.

bloomt’s picture

Can we get it patched into the dev version?

  • veronicaSeveryn committed 6fc4cce on 7.x-3.x
    Issue #2761645 by bloomt, jrb: Cannot import media : PHP Fatal error:...
veronicaseveryn’s picture

Status: Needs review » Fixed

Has been committed to 7.x-3.x-dev branch.

Status: Fixed » Closed (fixed)

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