Hello, first i'd like to say thanks for such a great module. Now to the problem.
I've got custom user-profile pages and it means that most of the code in user-profile.tpl.php.
Now i need to display form + views display to show status form and statuses, as it described in this issue http://drupal.org/node/435676#auto i put next code in user-profile tpl file
<?php
$account = user_load(array('uid' => arg(1)));
$size = variable_get('facebook_status_size_long', 40);
$view = 'facebook_status ';
echo theme('facebook_status_form_display', $account, $size, $view);
?>
This code works, form appears and stuff but, and here's a problem.
On default user-profile pages (pages which not customized) form works well. When user updates status view below sutomatically refreshes.
However, on customized profile pages form doesn't work that well.
When user clicks "Share" button whole page refreshes, then, if user tries to update status again ajax starts to work. So, i've no idea what's wrong. Is it a .js problem that doesn't work correctly?
Thanks again for great module.
Comments
Comment #1
Kane commentedBy the way, in addition one strange bug.
After i clear cache and click on share button on status form ajax starts to think a little longer and then huge windows popus up with tons of text ( part of my page). Here's a little part:
Error. \n/test/facebook_status/js\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
Browser: FF3.5.5
Comment #2
Kane commentedOk, one more thing. I believe it's the same issue as in "Undefined $facebook_status_field.val().length".
If i put code (check first post) to print form+statuses in block, and set it's position in, let's say, content region in main user profile page part of form will be different from those which should actually be.
Here's an example:
in .js file 3 and 4 line
Submit form should have following id: edit-fbss-status, but, because it's in block and in profile page it's changed to edit-fbss-status-1.
Is there a good way to print user statuses and form instead of those that i use? Thanks.
Comment #3
icecreamyou commented#2 is the same as this. You can't have more than one status update form on the same page or Drupal will automatically change the ID and then the JavaScript won't be able to find it.
I think your original problem is similar to this. It sounds like the problem is that the AHAH JavaScript gets added at the wrong time. Once you've submitted the form, it's then already added properly so AHAH-refreshing works. That's part of core, so I'm not sure anything can be done about that, although you might try using
$account->content['facebook_status']['status']['#value']instead of the theming code you currently have. Does the character counter work?Re #1, that is probably happening because for some reason the AHAH is getting a 404 or similar instead of the JavaScript callback page it expects. Again, it's in core, so I'm not sure what's going on there.
Also, I'm not sure if it's relevant or not, but the code in the first post has
$view = 'facebook_status 'and there shouldn't be a space at the end of the view name.Comment #4
Kane commentedCharacter count works only on default profile template, block with fbss form displays NaN characters.
#2 I suspected that Drupal automatically changes forms if one already exists.
Just checked $account->content['facebook_status']['status']['#value'] code.
Everything works ok, also characters count started to work properly, still, error with AHAH exists. Tried on Latest Opera same thing. I'm not sure, but it seems like whis error happens only when i logged in as Admin.
Just for more info, i've got some custom javascript and also quicktabs blocks, is it posssible that they affect FBSS?
Thanks.
Comment #5
icecreamyou commentedYeah, this issue is probably a duplicate of #636424: AHAH updates + Quicktabs AJAX.
Comment #6
Kane commentedAnd again, one more thing:
Let's say i write something in status textfield and then, instead of clicking on Share button i hit 'Enter' - it leads to page refresh, not ajax load. I guess it' shouldn't be like that.
Only exists on textfield (one row text-field), on text-area with couple of rows it just inserts new paragraph (as it sould be).
Comment #7
icecreamyou commentedThat's a Drupal core bug, not a FBSS bug. There's nothing I can do to change it.
Comment #8
Kane commentedThanks, i guess i'll just use text area.