Want to change behaviour of comments

Claus Lampert Posted in Technical Support 8 years ago

I want to have some changes in the behaviour of the comment - function.

1.) I want to have a button "SEND"

In the file /components/OssnComments/plugins/default/forms/OssnComments/post/comment_add.php I can add at the end:

<div style="float:right;">
<div class="ossn-loading ossn-hidden"></div><input class="btn btn-primary ossn-wall-comment" value="send type="submit">
</div>

Now I have the problem, that this button doesn´t work as I think it should work. I think that there is a problem with the object-id. Any ideas how to realize such a button?

Replies
Byelorussian Nice Guy Replied 8 years ago

Oops sorry Clause Lampert, i thought

<input class="btn btn-primary ossn-wall-comment" value="send type="submit">

was his original code .

For me the right syntax is

<input class="btn btn-primary ossn-wall-comment" value="send" type="submit">
Byelorussian Nice Guy Replied 8 years ago

Oops sorry Clause Lampert, i thought

<div class="ossn-loading ossn-hidden"></div><input class="btn btn-primary ossn-wall-comment" value="send type="submit"> was his original code .

For me the right syntax is

<div class="ossn-loading ossn-hidden"></div><input class="btn btn-primary ossn-wall-comment" value="send" type="submit">

German Claus Lampert Replied 8 years ago

Thank You "Nice guy", but the quotation-mark lacks only here in the posting, not in the original source-code. :-)

<div style="float:right;">
<div class="ossn-loading ossn-hidden"></div><input class="btn btn-primary ossn-wall-comment" value="Senden" type="submit">
</div>

It vanished when I edit it from the original "Senden" from my site to "send" here in the posting.

Byelorussian Nice Guy Replied 8 years ago

Hello,
At first a simple thing, you forgot to close the quotation mark after send .
I don't know if it can fix your problem but i think your syntax is not correct
Guy

German Claus Lampert Replied 8 years ago

https://trading-chatroom.de

user: tester
password: tester

Indonesian Arsalan Shah Replied 8 years ago

Please send us your website URl, i shall take a look i am don't know why its behaving strange.

German Claus Lampert Replied 8 years ago

@Arsalan Shah
Sorry, but I don´t find the difference between what happens when I press [ENTER] (->Javascript) and pressing a submit-button in the form - element.
There must be something in the Javascript that sends something different than the submit-button, maybe an object ID or something like that.

I try to explain:
There is no comment and I press [Enter]: comment -1- appears. I press [ENTER] again: comment -2- appears. This is how it should be.

But:
There is no comment and I press "my" submit-Button: the message-box "error" appears and the comment isn´t stored. If there is a comment -1- and I press the submit-Button: comment -1- is duplicated and now there are two identical comments under the posting.

Indonesian Arsalan Shah Replied 8 years ago

The reason you are getting the error box because the comment isn't posted see :

https://github.com/opensource-socialnetwork/opensource-socialnetwork/blob/v4.x/components/OssnComments/plugins/default/js/OssnComments.php#L53-L56

You have to look why the comment isn't really get posted and server sends 0 response (not posted/error in posting).

German Claus Lampert Replied 8 years ago

Behaviour:
First comment: when I click the button the message "Something went wrong! Reload this page and try again." appears.
Following comments: when I click the button, the previous comment appears again. When I want to save, for example, comment nr. 3 the comment nr. 2 will be duplicated. I think that the click on the button fails to send the correct object-ID.


Verhalten:
Wenn ich den ersten Kommentar absenden will, erscheint ein separates Fenster mit dem Fehlerhinweis "Irgendwas ist schiefgelaufen - versuche, die Seite noch einmal neu zu laden".
Wenn ich weitere Kommentare (z.B. Kommentar Nr. 3) absetzen will, wird der jeweils vorherige Kommentar (z.B. Kommentar Nr. 2) nochmals gespeichert. Ich habe den Eindruck, als würde der Klick auf den Button die falsche Objekt-ID übergeben.
Das Verhalten betrifft nur den Klick auf den Button, die ENTER-Taste sendet den Kommentar ordnungsgemäß!

German Michael Zülsdorff Replied 8 years ago

Can't follow.
There's a posting on the newsthread. Ok.
Now someone is trying make a first comment: What error are you getting?