Hi, there--

I'm sort of new to drupal so I have inherited a problem here. When someone attempts to attach a link to a status, but leaves the "status" box blank, the link will not show in the view where we list all of the users' posts.

The problem I see is in the facebook_status view, where there is a "Filter" on "Facebook-style Statuses: Status text != ". Is there some way to filter for EITHER non
I'm unsure whether this is a default view that comes with the fbsmp module or not, but is there some other filter I could use to test whether there is meaningful content coming from the "facebook-style statuses" OR the "facebook-style micropublisher"?

Thanks for any help!

Comments

ferfong’s picture

Project: Facebook-style Statuses (Microblog) » Facebook-style Micropublisher
Version: 6.x-2.3 » 6.x-1.x-dev

I'm sorry; I didn't realize this is likely a facebook_status module question, not a fbsmp question.

Edit: Actually, even more of a views question than a facebook_status question

ferfong’s picture

Project: Facebook-style Micropublisher » Facebook-style Statuses (Microblog)
Version: 6.x-1.x-dev » 6.x-2.3
ferfong’s picture

As a compromise, is there some way to change the default text if the status is blank? Currently it adds "user does not have a status" with the attachment if they do not have a status. Could we simply keep this as the blank string?

I see that this is hard-coded in facebook_status.module, so it does not appear to be easily changed... Perhaps I'm missing a configuration setting somewhere?

publicmind’s picture

Project: Facebook-style Micropublisher » Facebook-style Statuses (Microblog)
Version: 6.x-1.x-dev » 6.x-2.3

1) You can add or remove any number of filters in the facebook_status view. So if you want the status to appear when there is status text, or an attachment just go ahead and attach a filter.
2) I am not sure what you mean by meaningful and how you define it. You can surely check for emptiness though.
3) To change the default text, go to your FBSS advanced settings page and change the default text. Although, you won't be able to post it. FBSS, by default, neglects the default text. But if you post a FBSMP attachment, you can turn on a FBSMP setting to post the default text as well.

icecreamyou’s picture

Status: Active » Fixed

Thanks publicmind.

Adding a view filter for the case "status is not empty or has an attachment" might be a good feature request against FBSMP at some point.

ferfong’s picture

I'm sorry, I didn't realise the "default text" that was set to the "last status" was what was showing up as "does not have a status". Thanks very much for the clarification!

Edit; nevermind, I just reread what you wrote and understand what you were telling me. Still not quite what I was hoping for--the "does not have a status" doesn't come from the default text in the advanced settings pane, but I do see the option to ignore/not ignore the default text in FBSMP so I understand I can change the default text to be something that would make sense to be displayed with an attachment if no status update was made.

It would still be nice to just not force the status to say "does not have a status" when we are displaying both the status and themed attachment in the facebook_status view. Am I wrong in thinking that the "does not have a status" text comes up whenever a status is displayed but the text is blank? That appears to be what is happening in facebook_status.module....?

As for 'meaningful' I just meant that the status is not empty or has an attachment, which apparently could be a feature request. :)

Thanks again to both of you!

icecreamyou’s picture

Title: Facebook status View filters for empty status message » Add a view filter for the case "status is not empty or has an attachment"
Project: Facebook-style Statuses (Microblog) » Facebook-style Micropublisher
Version: 6.x-2.3 » 6.x-1.x-dev
Component: User interface » Code - Functionality
Category: support » feature
Priority: Normal » Minor
Status: Fixed » Active

ferfong, I'm not quite following what you're saying, but I'm just going to go ahead and move this to feature request status because I like the idea.

publicmind’s picture

ferfong,

It doesn't make sense for FBSS to allow posting default status. IIRC, you can always translate the string 'does not have a status' to anything you like.

But when the status have a FBSMP attachment, you are allowed to post blank status text. In such a case, only themed attachment is shown. You can also enable a settings on FBSMP settings page, which will allow you to post the default status text. i.e. if user doesn't edit the status text field and the setting is on, an attachment with default status would be shown.

I hope it explains.

Cheers,

liliplanet’s picture

Priority: Minor » Normal
StatusFileSize
new45.59 KB
new8.47 KB

Would you be so kind to point me in the right direction please.

I'm trying to create a flag friend view ..

When I add the filter Facebook-style Statuses: Status text 'status is not equal to' blank value' I only get facebook status text and no fbsmp attachment.

When I add the following filter to the above Facebook-style Micropublisher: Attachment type 'status is not equal to' blank value' I only get attachments with status, but no status on it's own.

When I remove the filter Facebook-style Statuses: Status text 'status is not equal to' blank value' I get just very old and obsolete statuses.

I'm attaching my view (without trying Flag Friend) as first of all have to figure out how publish all of the following:

1. Post an individual status (without attachment)
2. Post an attachment (without status)
3. Post a status and attachment

The attached view shows only attachments that have a status.

Would so much appreciate your help or perhaps an exported view please?

see attached view and screenshot .. and thank you so much :)
Lilian

pribeh’s picture

I've produced a lot of views like this without the said problem you're running into. That said, I will try to reproduce your problem by running the attached view. Just a quick question though: from the looks of the gif you got there it would appear as if you're using Views 3.x(?).

liliplanet’s picture

Thank you Pribeh for your super-fast response :)

Yes Views 3.x, does that make a big difference?

pribeh’s picture

Although I can't speak for IceCreamYou or Public Mind I have yet to test Views 3.x yet with statuses/relationship-type views. I'm going to give your view a try though and report back soon.

liliplanet’s picture

Thank yo so much Pribeh :) In specific it would be for Flag Friend ..

icecreamyou’s picture

I have not tried Views 3.x with FBSS and I would be surprised if it worked.

liliplanet’s picture

oops, that can't be good ..

Have been running Views 3.x for about 6 months now without any problems, please would you perhaps do a test?

This is most important as want to start FB + Publisher with flag friend status as a singular view.

FB Status + FBMP + Flag Friend + Activity works perfectly together .. just need it on it's own as I'm separating the two modules (Activity and FB status.)

The reason I'm separating Activity (which is public) and FB + Publisher status (is only between friends). Also so love the FB comments capability.

Most appreciate your wonderful modules, thank you.

Lilian

liliplanet’s picture

StatusFileSize
new42.34 KB
new5.88 KB

Hi,

Great :) I've downgraded from views 3.x to views 2.x which was quite a job .. http://drupal.org/node/829322

It's just that flag friend, FBSS and FBMP is so important and really would like to make it work.

Unfortunately I'm still having the same issue as in #9:

1. Post an individual status (without attachment)
2. Post an attachment (without status)
3. Post a status and attachment

See attached 2.x view and screenshot.

Please, would so appreciate any guidance on how to make FB Status show that includes 1, 2 and 3 (above).

I'm prepared to pay for an exported view that makes this happen, especially with flag friend, but first get the above sorted :)

Lilian

publicmind’s picture

@Lilian

At this point, you would want to turn off your filter which says, status is not empty. Although I notice that you "get just very old and obsolete statuses". They are probably the statuses which have no text and also doesn't have an attachment. That is why, we need such a filter which is stated in the title.

@IceCreamYou

I am attaching my first shot at the filter, please review.

Thanks,

icecreamyou’s picture

You're doing a lot of extra work there. Something like this should work for query():

function query() {
  $fbsmp = $this->ensure_my_table();
  $fbss = $this->query->ensure_table('facebook_status');
  $this->query->add_where(0, "($fbsmp.type IS NOT NULL || $fbss.status <> '')");
}

I mean basically the idea is that {fbsmp} is already left joined to {facebook_status}, so you just have to check that some FBSMP data exists for each row, rather than jumping through hoops to see if it's assigned specifically to one of the plugins.

Other minor things:

 *   Filter to allow each status to have atleast status text or attachment.

"at least," not "atleast" -- this happens twice

    $this->definition['label'] = t('Show status only if status is not empty or has an attachment');

I think "blank" is more explanatory than "empty," but it's really just a matter of preference

      dpm($query);

Remember to remove this...

        $plugins = array_keys($plugins);
        foreach ($plugins as $key => $value) {
          $plugins[$key] = "'". $value ."'";
        }
        $subquery = implode(', ', $plugins);
        $subquery = '('. $subquery .')';
        $subquery = "$table.type IN $subquery";

This shouldn't be needed any more, but in the future you can write it more easily as $subquery = "$table.type IN (". db_placeholders(array_keys($plugins), 'text') .")";

Cheers

publicmind’s picture

Thanks Ice. I am checking through the plugins just to make sure that the current plugin is not disabled. I think it is necessary because if a plugin is disabled, then it returns a empty string for the attachment output, which won't be desired IMO.

Regards,

publicmind’s picture

For example, you post a 'photo' and then disable the plugin, it must be equivalent to the 'status without attachment'.

Regards,

publicmind’s picture

How about this?

  function query() {
    if ($this->value) {
      $table = $this->ensure_my_table();
      $fbss = $this->query->ensure_table('facebook_status');
      $query = "$fbss.status <> ''";
      
      $plugins = fbsmp_get_plugins();
      if(is_array($plugins) && count($plugins) > 0) {
        $subquery = "$table.type IN (". db_placeholders(array_keys($plugins), 'text') .")";
        $query .= " OR ( $table.type IS NOT NULL AND $subquery )";
      }
      
      $this->query->add_where(0, $query, array_keys($plugins));
    }
  }

Regards,

icecreamyou’s picture

That looks good to me.

publicmind’s picture

Assigned: Unassigned » publicmind
Status: Active » Fixed
pribeh’s picture

Awesome. I'm going to test it out.

liliplanet’s picture

Status: Fixed » Active

Thank you icecreamyou, publicmind and and pribeh, works fabulously :)

publicmind’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

Marko B’s picture

Category: feature » bug

You should determin is this AND or OR, meaning, is this text AND image/text OR image. In describtion text you say AND, but in code it's actually OR and this is a big difference.

Anway i changed it to AND for my purposes, as i want to show status only if there is image and text. OR would probably be better for default.

My suggestion is to have this in 2 separate filters, views 3 offers to combine filter so users can then choose is it OR or AND. That would be best solution.