e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
323 stars 214 forks source link

Strange news editing behaviour on admin dashboard.... #1489

Closed rica-carv closed 8 years ago

rica-carv commented 8 years ago

I've got a few strange issues when editing already existing news, via the admin dashboard, under the news list editor:

I'm using the BS3 admin theme, on V2.1....

CaMer0n commented 8 years ago

@rica-carv I'm sorry, but I'm unable to reproduce this. Do you have hacks/modifications active?

rica-carv commented 8 years ago

@CaMer0n Hi, no hacks or modifications on my side, just plain simple clean v2.1 installation...

First load of news editing: untitled 1

Second load of the same news, after updating it (body text all clean!): untitled 2

rica-carv commented 8 years ago

Tried again today, no go.... Even when i paste text inside the editor text box, or even if i write anything, or even if i clear the SEF URL field, after clicking update, i got this message, stating nothing was updated, since nothing was changed :confounded: .... untitled Currently, the database fields are like this: untitled 1

I can only solve this issue editing directly on the database....

I'm using V2.1.0 (git), on PHP 5.3.5, with MySQL 5.5.8, on a local webserver working from a USB pen....

Plugins installed myself: banner Plugins installed on e107 install: featurebox, gallery, rss_menu, social, tinymce4, user All plugins currently installed created by E107 Inc.

willem010 commented 8 years ago

1035

we had to reinstall the whole server to solve this. still i wonder what happened.

rica-carv commented 8 years ago

@willem010 I doubt the issue i have is due to a hacked server, since i got this issue on my development server, wich works on a usb pen. Anyway, can you tell me on wich version of PHP and MySQL you managed to get this issue solved?

willem010 commented 8 years ago

@rica-carv. we still do not know what caused the issue. but when we realised the server was hacked we just totally reinstalled the whole thing. a clean 2.0 install and manually copied some bit of old data to the new clean database.

anyway.. just changing ubuntu to debian and clean install solved it.. i believe mysql and php were same version as yours. on the debian we had a newer php version. i will post the exact version later today.

rica-carv commented 8 years ago

@willem010 thanks for your help, but i think won't help a lot, since i'm working with the webserver (Mowes portable) on a USB pen, and under Windows.....

willem010 commented 8 years ago

maybe its not the same issue. dunno. sure looks like it though. at least you can see what we tried..to rule out some stuff.. as mentioned before, it suddenly appeared after git update long long time ago and we never found what the real cause was.

good luck on hunting that bug. (y)

rica-carv commented 8 years ago

@willem010 I've just tested my server up and running on a XP machine and on a 7 machine, and always the same error.... Even if i don't edit anything, after i click submit, it changes the SEF and clears the news body... Just these two fields.... real weird....

rica-carv commented 8 years ago

Hi. I've run some tests, on my localhost USB mounted webserver, and got some strange issues, as report follows:

Information from code on the beforeUpdate public function on newspost.php:

Array
(
    [e-token] => aa9c866a93b9bde629cbcb55a417eed1
    [news_category] => 1
    [news_title] => Welcome to e107
    [news_summary] => Summary of the news item
    [news_render_type] => 0
    [news_author] => 1#ricardo
    [news_body] => [html]<p><strong>Lorem ipsum</strong> is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It&#039;s also called placeholder (or filler) text. It&#039;s a convenient tool for mock-ups. It helps to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero. Its words and letters have been changed by addition or removal, so to deliberately render its content nonsensical; it&#039;s not genuine, correct, or comprehensible Latin anymore.</p>
<p>While <strong>lorem ipsum</strong>&#039;s still resembles classical Latin, it actually has no meaning whatsoever. As Cicero&#039;s text doesn&#039;t contain the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the&nbsp; typographic appearence of European languages, as are digraphs not to be found in the original.</p>[/html]
    [news_extended] => 
    [news_thumbnail] => Array
        (
            [0] => 
            [1] => 
            [2] => 
            [3] => 
            [4] => 
        )

    [mediameta_news_thumbnail] => Array
        (
            [0] => 
            [1] => 
            [2] => 
            [3] => 
            [4] => 
        )
    [news_sef] => welcome-to-e107
    [news_meta_keywords] => welcome,new website

    [news_meta_description] => Description for Facebook and search engines.
    [news_allow_comments] => 0
    [news_start] => 0
    [news_end] => 0
    [news_datestamp] => 1454367600
    [news_class] => 0
    [news_sticky] => 0
    [submitted_id] => 
    [etrigger_submit] => Atualização
    [__after_submit_action] => list
    [submit_value] => 4
    [mode] => 
)

Information from code on the afterUpdate public function on newspost.php:

Array
(
    [news_id] => 4
    [news_title] => Welcome to e107
    [news_sef] => welcome-to-e107
    [news_body] => 
    [news_extended] => 
    [news_meta_keywords] => welcome,new website
    [news_meta_description] => Description for Facebook and search engines.
    [news_datestamp] => 1454367600
    [news_author] => 1
    [news_category] => 1
    [news_allow_comments] => 0
    [news_start] => 0
    [news_end] => 0
    [news_class] => 0
    [news_render_type] => 0
    [news_comment_total] => 0
    [news_summary] => Summary of the news item
    [news_thumbnail] => 
    [news_sticky] => 0
)

For me, something weird happens between both functions....

Did some further testing to rule out formatting on the body, with changes to the string i managed to make work.

So, for me, the issue is somewhere between the beforeUpdate and the afterUpdate, and has something to do with the html bbcode ([HTML]) and using html tags inside the text also....

Where does the db_Update occurs for the news table? I see a lot of them on newspost.php, but are commented out of the code....

I've already ruled out any MySQL issue, since i can directly insert the same install news text above on the database via MySQL frontend, without any errors, so MySQL accepts the text that e107 doesn't....

CaMer0n commented 8 years ago

If you're using bbcodes and shortcodes inside WYSWIYG, then expect unpredictable behavior. Disable WYSIWYG if you want to use those. I pasted your longer, 2nd test into the source of the WYSIWYG editor, and saved it and re-opened it without any issue.

rica-carv commented 8 years ago

@CaMer0n Errr, i must be doing something wrong, since i switch to the source code under the news editing, paste my previous text wich failed (2nd test), et voilá, error pops up again.....

What's your PHP & MySQL version????

CaMer0n commented 8 years ago

PHP Version: 7.0.3 MySQL : 5.6.28

rica-carv commented 8 years ago

@CaMer0n @willem010 Today, after further testing and after changing my development server to UniformServer (Mowes was discontinued... :cry: ), situation seems to be solved. Aparently it was really a server issue, since Mowes was using Apache 2.0, and UniformServer Apache 2.4, and it seems that from 2.0 to 2.4 a lot has changed. So, for now, i'll close this issue... Thanks all....