Here is the error that comes after you check "Mark all Media Objects for update?" and press save configuration

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'class' in 'where clause': UPDATE {drealty_classes} SET media_lastupdate=:db_update_placeholder_0 WHERE (conid = :db_condition_placeholder_0) AND (class = :db_condition_placeholder_1) ; Array ( [:db_update_placeholder_0] => 0 [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 6 ) in drealty_resource_configure_form_submit() (line 1393 of /var/www/test1/sites/all/modules/drealty/includes/drealty.connection.admin.inc)

Comments

bloomt created an issue. See original summary.

shauntyndall’s picture

Assigned: Unassigned » shauntyndall
Status: Active » Needs review
StatusFileSize
new503 bytes

@bloomt, can you test this patch against your install?

bloomt’s picture

Patch fixes error, although I cannot figure out how to get media to import in the first place.

shauntyndall’s picture

StatusFileSize
new747.93 KB
new736.21 KB

@bloomt, thanks for testing. I'll get that committed to the dev branch for the next release.

Regarding the media processing. The media processing works like this:

1) A media object field is mapped to a drealty entity field.
2) Properties are queued for processing.
3) Cron or drush is run to process queue items.
4) As each property is processed the mapped field causes a media item to be queued for processing.
5) Cron or drush processed the media queue.
6) Profit.

There are direct drush commands for queuing & processing:

* rets-import (ri) - Import RETS entities with basic fields.
* rets-import-media (rim) - Queue RETS entities for Media Objects processing.
* rets-process-media (rpm) - Process any Media Objects that are queued up in the system.
* rets-process-queued-properties (rpqp) - Process any RETS items remaining in the queue.

I've attached a couple screenshots of a project running rc1 in production on the Pantheon hosting platform. We are using text fields to map the image url from RETS because the MLS doesn't like images to be downloaded.

bloomt’s picture

Are media objects processed automatically with drush rets-import or do I need to setup a separate task to import images on my server?

Error I get when running drush rpm

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#

bloomt’s picture

Same error when I run cron

root@dev:/var/www/test1# drush cron
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

avo webworks’s picture

The patch above works but I also get this error upon import:
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 install with 7.x-3.0-rc1 installed.

bloomt’s picture

@shauntyndall and @avostar I am going to close this ticket and start a new on for the is_connected issue. This tickiet is initially related to the broken update Mark all Media Objects for update? button which is resolved with the patch.

@shauntyndall if you can commit the patch to the dev version that would be great.

duntuk’s picture

StatusFileSize
new50.86 KB
new45.18 KB

@shauntyndall I too am unable to get images to import via the new "Search query" option.

Since my RETS provider doesn't support getObject nor do the 'key field' names match between the 'property' and 'media', there is no option to "process media", as is shown in your screenshots.

So I'm guessing since there is no option to check "process media", drealty doesn't process any media via getOject or 'search query'.

If I'm not mistaken, the "process media" option was also not available due to one (or both?) of the above not having a matching key name or available via getObject)

The matching key fields used to map the 'property' to 'media' are the following for my RETS provider CRMLS.org:

Property = ListingKeyNumeric
Media = ResourceRecordKeyNumeric

(yes, verified that these are the only matching key values between the two, so that's the only way to pull associated images)

See connection configuration here:
https://www.drupal.org/files/issues/2016-07-09_065526.png

See image field configuration here:
https://www.drupal.org/files/issues/2016-07-09_065602.png

jday’s picture

The patch worked to fix the error when checking the 'Mark all Media Objects for update?' box, however, since upgrading to rc1 from beta6 I have not been able to get the photos for the listings working, was there an upgrade path I missed?

duntuk’s picture

From initial appearance, RC1 seems promising as it seemingly covers the ability to pull images via the following additional new methods:

1. Search query to download images to server.

Note: This seemed straight forward, but didn't work for me, due to not even being able to select "process media" checkbox. That option (and maybe other checks in code) seems dependent on the combination of (outstanding issues) REQUIRING key names to be IDENTICAL under connection settings for "property" and "media"--my RETS CRMLS.org uses different key names for identical keys.

2. Search query to pull image URLs into a field (this needs instructions; and same as above about not being compatible with different key names)

3. getObject method to pull image URLs into a fields (my RETS provider CRMLS.org doesn't support getObject anymore, so can't test this)

jday’s picture

@duntuk were you able to pull images with prior version of drealty? I never had problems with images before, but now I am lost as to how to configure this.

duntuk’s picture

I was able to pull images successfully PRIOR to our RETS (CRMLS.org) disabling support for getObject.

Unfortunately even with RC1's claimed support for obtaining media via 'search query' didn't work.

bloomt’s picture

Has anyone been successful importing images on RC1?

shauntyndall’s picture

I'm going to try and put together a demonstration video in the next few weeks. It may also help to schedule some office hours for the module soon to provide support & sprint on some bugs that have arisen.

Sorry for the lack of documentation...we'd love any help we can get on that.

jday’s picture

Anyone else seeing these errors?
1. clone basic property type
2. add an image field
3. save

Notice: Undefined index: mappings in drealty_form_field_ui_field_edit_form_media_object_submit() (line 1287 of /var/www/test/sites/all/modules/contrib/drealty/drealty.module).
Warning: Invalid argument supplied for foreach() in drealty_form_field_ui_field_edit_form_media_object_submit() (line 1292 of /var/www/test/sites/all/modules/contrib/drealty/drealty.module).
veronicaseveryn’s picture

Status: Needs review » Fixed

@duntuk, for support for obtaining media via 'search query' please refer to this issue: https://www.drupal.org/node/2384463. I have compiled an "initial" idea of how to handle it (and it has been included into 7.x-3.x-rc1 release), though I had no opportunity to test it with real data, as the RETS systems I have been dealing with don't have this issue, so I cannot confirm 100% it works as expected. You can re-open the issue so we can look at it again, but the best would be if I could have access to MLS that doesn't support GetObject() call. I will provide comments on that issue as to how configuration was intended to work for it, and then we'll see how we can move forward from there.

For Documentation on how to Import Media, I have started another issue: https://www.drupal.org/node/2779207 (and have committed some changes to the README file into 7.x-3.x-DEV branch). It will be gradually improved.

As for this particular issue "Mark all Media Objects for update? - Broken", I have committed the patch into Dev branch. Undefined call isConnected() bug has also been resolved and committed into DEV version: https://www.drupal.org/node/2761645

Marking this issue as Fixed.

Status: Fixed » Closed (fixed)

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