I created a simpleads block view, with the simpleads style plugin, title and image ad fields, and a taxonomy ad group filter. In the preview I cannot see nothing, but when I go to the front page (where I added the block), I got the following errors, and I cannot see the ads, just the title of the block (I can confirm that I have 2 ads in the filtered group):

    Notice: Undefined property: views_plugin_query_default::$limit en template_preprocess_views_simpleads() (línea 52 de /var/aegir/platforms/commerce/sites/example.com/modules/simpleads/includes/simpleads.integration.inc).
    Notice: Undefined variable: tid en template_preprocess_views_simpleads() (línea 64 de /var/aegir/platforms/commerce/sites/example.com/modules/simpleads/includes/simpleads.integration.inc).
    Notice: Undefined variable: tid en template_preprocess_views_simpleads() (línea 73 de /var/aegir/platforms/commerce/sites/example.com/modules/simpleads/includes/simpleads.integration.inc).
    Notice: Undefined variable: tid en template_preprocess_views_simpleads() (línea 75 de /var/aegir/platforms/commerce/sites/example.com/modules/simpleads/includes/simpleads.integration.inc).
    Warning: array_merge(): Argument #1 is not an array en _simpleads_render_ajax_template() (línea 154 de /var/aegir/platforms/commerce/sites/example.com/modules/simpleads/includes/simpleads.helper.inc).

Any idea about waht is happening?

Comments

minnur’s picture

Please try to enable default example SimpleAds View and see if that works. If it does, just clone it.
Please note that the sample View has minimum required configuration (e.g Fields etc..).

akalam’s picture

Component: Code » Documentation

I got it!
Now I understand that, in order to get views support, you cannot use any fields but the "Content: Ad Group" field. Its true that the README suggest to enable the example view and then you can understand this point, but I think that it still not very clear. May be it could be a little bit more documentated?

Also, to get all the strong about views, is important to could configure how the fields are displaying, and Ad Group field is like a node list itself, not exactly a field, and you cannot configure, for example, image-styles for specifc blocks or views, but this is another stuff. Should I create another issue for that?

I also have to tell that I'm very positively suprised about this module, becouse it is filling the empty that the ads module created in our drupal 7 hearts. Thank you very much, also about the fast support!

sachinbal’s picture

Hi,

I have a query on SimpleAds and I was not getting the right forum to post my query and hence posting this here. I have installed the SimpleAds module and I can see it under the "content types" but I am not able to add it to a block. Can someone please guide me on the same?

Thanks

Sachin

minnur’s picture

@sachinbal , it should be on Structure -> Blocks page. If you would like to add a new block, simply create a new taxonomy term in Ad Group vocabulary.

billsdesk’s picture

When I edited the SimpleAds View example in Views, I got a message about field errors. The only solution was to create one field for a text ad, which I am trying to create. However, every time I save a view, I get the following error message:

Notice: Trying to get property of non-object in _simpleads_node_stat_tab() (line 174 of sites/all/modules/simpleads/includes/simpleads.helper.inc).

I also discovered that the machine name was block_1. I was receiving warning errors every time I loaded a page about simpleads_block not found. I changed the machine name to simpleads_block, and the error went away. Am I missing something?

minnur’s picture

Assigned: Unassigned » minnur
Status: Active » Needs review

I am not sure. I will check this soon. Thanks.

minnur’s picture

Version: 7.x-1.7 » 7.x-1.x-dev
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

bpriceless’s picture

Changing the Pager settings from "display all" to "display a specific number of items" works around the "undefined property" notice/error.

rajasekar33’s picture

Status: Closed (fixed) » Patch (to be ported)

when your Changing the Pager settings "display all"
getting Notice error: Notice: Undefined property: views_plugin_query_default::$limit in template_preprocess_views_simpleads() (line 148 of /.../sites/all/modules/simpleads/includes/simpleads.theme.inc).

Suggest to replace line 148

//the problem is happen for ads_list limit. when setting "display all" delta_limit->all

- $limit = check_plain($view->query->limit);

+ $limit = (isset($view->query->limit))?check_plain($view->query->limit):count($rows);

minnur’s picture

Status: Patch (to be ported) » Fixed

Dev version already has the following code:

$limit = property_exists($view->query, 'limit') ? check_plain($view->query->limit) : $default_limit;

Status: Fixed » Closed (fixed)

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