Произошла ошибка при попытке сохранить ресурс modx

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account

  • Главная/
  • Вопрос — ответ

Произошла ошибка при попытке сохранить ресурс

Версия MODX: Revolution

Здравствуйте!
Установил MODX Revolution локально.
Все встало нормально. Когда зашел на сайт, вместо белой страницки увидел ошибку 404. Оказалось при установке не было создано документа Home

Попытался создать дочерний документ, получил ошибку

Как исправить ситуацию. Попробовал переустановить MODX это не помогло, проблема осталась. В чем может быть дело?

  • Теги:
  • ошибка при попытке сохранить ресурс

Комментарии (2)

  1. oleg001 27.06.2014 08:32 #

    Привет!
    Блин та же история…http://floomby.ru/s2/fWu5aN не сохраняются ни чанки не сниппеты. Вы не решили этот вопрос? Пробовал обновить модх, обновление прошло, но ошибка так же и осталась. Думаю что проблема в БД.
    Вопрос открыт, знающие напишите что делать, у меня 3 день работа стоит!!!


  2. Amigo 26.11.2015 08:41 #

    Тоже встретил это при создании ресурса. Решил тем, что изменил alias ресурса. Посмотрите при очистке кэша на сообщения вида:
    — Resource URI already exists for resource id = 5420; skipping duplicate resource URI for resource id = 5421
    — Я полагаю из-за дублирования алиасов может возникнуть данная проблема.


xPDOObject::save()¶

Сохраняет новые или измененные объекты в контейнере базы данных. Также будет каскадно и сохранять любые объекты, которые были добавлены к нему с помощью методов добавления связанных объектов (addOne, addMany).

Синтаксис¶

API Docs: http://api.modxcms.com/xpdo/om/xPDOObject.html#save

boolean save ([boolean|integer $cacheFlag = null])

Примеры¶

Спасите палочку вместе с ее владельцем и запчастями.

$owner = $xpdo->newObject('Wizard');
$owner->set('name','Harry Potter');
$parts = array();
$parts[1] = $xpdo->newObject('WandPart');
$parts[1]->set('name','Phoenix Feather');
$parts[2] = $xpdo->newObject('WandPart');
$parts[2]->set('name','Holly Branch');
$wand = $xpdo->newObject('Wand');
$wand->addOne($owner);
$wand->addMany($parts);
if ($wand->save() == false) {
   echo 'Oh no, the wand failed to save!';
}

Это может быть немного сложнее при работе со связанными объектами, но вы можете пропустить несколько шагов (при условии, что вы правильно определили свое отношение). Например, обычно при работе с таблицами объединения вам необходимо знать первичный ключ из связанных таблиц, прежде чем вы сможете добавить туда строку. Однако с xPDO вы можете опустить первичный ключ из одной таблицы, когда ссылаетесь на связанную таблицу с помощью addMany() или addOne().

$Product = $modx->newObject('Product');
$ProductImage = $modx->newObject('ProductImage');
$ProductImage->set('image_id', 123);
//$ProductImage->set('product_id', $lastInsertId); // You can skip this
$related = array();
$related[] = $ProductImage;
$Product->addMany($related);
$Product->save();

Если операция создала новую запись (вместо обновления существующей), вы можете связать методом PDO::lastInsertId():

$modx->lastInsertId();
// OR
$object->getPrimaryKey();
// OR
$object->get('id'); // <-- или как называется основное поле

Успех может варьироваться в зависимости от основного драйвера.

Сообщения проверки¶

Вы можете сделать больше, чем просто реагировать на логическое yes/no, правильно ли сохранен ваш объект. Вы также можете вернуть некоторые сообщения о том, что именно было проблематично.

// сохранить объект и сообщить об ошибках проверки
if (!$object->save()) {
    // @var modValidator $validator
    $validator = $object->getValidator();
    if ($validator->hasMessages()) {
        foreach ($validator->getMessages() as $message) {
            $this->addFieldError($message['field'],$this->modx->lexicon($message['message']));
        }
    }
}

В конечном итоге, добавление поля error добавляет сообщения в стек ошибок MODX ($modx->errors). Каждое сообщение представляет собой ассоциативный массив с идентификатором и сообщением.

Вы можете быть немного более краткими, используя такой код (необходима очистка):

if ($object->save() == false) {
    $modx->error->checkValidation($object);
    return $this->failure($modx->lexicon($objectType.'_err_save'));
}

Смотрите modProcessor::addFieldError() в modprocessor.class.php и modError::addField() в error/moderror.class.php

Open COllective

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

Budget

$400 per month—let’s make that $500!

Learn more

Summary

User receives Permission Denied error message On Save Resource but page still saves correctly. User has limited permissions but permissions to save.

Code: 200 
OK {"success":false,"message":"Permission denied!","total":0,"data":[],"object":[]}

on-resource-save-error

Step to reproduce

I added the permission view_users as suggested in #12103 and it stopped the popup. But I do not what to give that permission to the user groups.

Observed behavior

The error message in the photo above but the resource did save.

Expected behavior

Save as normal.

Environment

MODX 2.3.3pl, nginx on MODX Cloud

Related to #12103

Thanks for reviewing!

Перейти к контенту

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account

Большой объем кода — ошибка.

Subscribe: RSS

Login to Post

    • 36423

    • 2 Posts
    • Send PM

    cratte Reply #1, 11 years, 5 months ago

    Здравствуйте.
    При добавлении большого объема информации на новый ресурс modx 2.1.3 выдает ошибку: Произошла ошибка при попытке сохранить ресурс.
    Та же история с чанками и снипетами: если кода много, то выдается ошибка. Modx evo 1.0.0-RC3 c этим объемами справляется «на ура».
    В чем может быть проблема? Это связано с CMS или может в базе нужно какие настройки поменять?

      • 36423

      • 2 Posts
      • Send PM

      cratte Reply #2, 11 years, 5 months ago

      Проблема снята, дела было в настройках базы.

      Бесконечное сохранение ресурсов в MODX


      27 августа 2018, 22:49

        
      Alex

      MODX Revo

      0

        
      3590





      0



      Недавно возникла проблема в админке MODX при редактированиии и создании нового ресурса.
      При нажатии на кнопку «сохранить», — ресурс начинал бесконечно его сохранять и в консоли вываливались ошибки:

      Uncaught SyntaxError: Unexpected identifier
          at doDecode (ext-all.js:21)
          at Object.decode (ext-all.js:21)
          at Ext.form.Action.Submit.handleResponse (modx.jsgrps-min.js:1)
          at Ext.form.Action.Submit.processResponse (ext-all.js:21)
          at Ext.form.Action.Submit.success (ext-all.js:21)
          at o (ext-all.js:21)
          at Ext.data.Connection.s (ext-all.js:21)
          at HTMLIFrameElement.I (ext-all.js:21)
      

      Проблема была в браузере, а не самом MODX. В Opere всё работало отлично, а в Chrome админка начинала вести себя капризно.

      Бесконечное сохранение ресурсов в MODX

      красная пунктирная линия

      Решение проблемы

      Оказалось, это был просто конфликт с расширением в Chrome под названием «MusVK». Достаточно его отключить и работа сайта нормализуется.


      Поделиться с друзьями


      Похожие статьи:

      MODX ➨ условия if-else
      MODX Shopkeeper 3 — проблема с плагином мультивалютности
      Tickets: как сделать счетчик просмотров всех посетителей
      Правильный файл robots.txt для CMS MODX Revolution
      Правильный файл .htaccess для CMS MODX Revolution

      Комментарии ()


      1. Григорий Komsomol
        13 октября 2018, 12:38
        #



        +1







        Спасибо! Ваша инструкция сэкономила много времени!


        1. Алексей Власов
          13 октября 2018, 18:57
          #




          0







          Спасибо за комментарий! Рад, что помог!

        Вы должны авторизоваться, чтобы оставлять комментарии.

        Вы можете авторизоваться на сайте через:

        YandexVkontakte

        @xpix

        xpix created Redmine issue ID 3638

        Hi,

        From time to time the manager doesn’t save the document I just edited.
        The «Please Wait/Saving» overlay appears and stay there forever.

        If you just added content you cannot go back by pressing ESCAPE or by closing that overlay which means that you need to refresh the page.
        By refreshing the page the new content is lost.

        Please provide a way, a close button for now, that will close the overlay and allow users to re-save.
        When the overlay is closed by pressing the close button a message should appear and say «Your data has not been saved. Please try again. If this continues to happen save the data in a file on your computer, reload the page and re-paste the content».

        A better solution would be to implement a timer(configurable from settings) for the «Please Wait/Saving» message. If the document is not saved in 20 seconds you should alert the user to save the new content in a different format, reload and paste the content again and save.

        Currently I am not sure if this is a MODX only problem or maybe from time to time the host doesn’t properly answer to the MODX request but it never happen on Evo, and I know it happened in Revo in previous versions.

        I attached a screen-shot with my thoughts. I keep posting what I find but I suspect a js error.

        Thank you

        @splittingred

        splittingred submitted:

        Please do not assign target versions. Thanks.

        @MokoJumbie

        MokoJumbie submitted:

        Can somebody assign a target version to some of these super old major bugs? this is a serious bug which can result in a loss of data and is over 2 years old. There are a lot of really old issues which are being forgotten about and would really do to be resolved in new versions of MODX. I don’t know how to feel about requests to aid in finding new bugs to squash in upcoming releases when the old bugs are just getting buried.

        I can verify that this still exists in 2.2.5. If it helps, I believe it can be produced by having a connection drop before saving is completed. This is probably not the only cause, however.

        @opengeek

        opengeek submitted:

        I cannot reproduce this bug. I suspect this was related to mod_security rules applied in the server environment and preventing POST requests containing certain HTML tags or other content matching it’s filters.

        @MokoJumbie

        MokoJumbie submitted:

        I will try to look into this some more so I can give you more details.

        Your suspicion may be correct, but if so, I don’t believe mod_security is the culprit in at least some (if not most) of the cases I’ve seen. It has happened on several different servers and not consistently. Often the problem can be fixed by restarting the user’s browser or computer. Can someone corroborate this aspect of the bug for me?

        I think there are two issues here. First is the question of what’s causing the issue in the first place, which seems a bit ambiguous. But secondly, I don’t feel enough is being done by the manager to prevent submitted data from being lost should a request fail. Can a request which takes too long be canceled, notifying the user of the failure and allowing them the opportunity to save their entered content. Even better would be to save the submission content in sessionStorage or localStorage for recovery in the event of such a failure.

        Thanks for looking into this.

        @MokoJumbie

        MokoJumbie submitted:

        Still looking into this, but forcibly attempting to remove access to the server during a save yields the results seen in Issue #9147, not the result seen in this bug. Anyone have any luck in reliably reproducing this?

        @MokoJumbie

        MokoJumbie submitted:

        I just got this bug again. No idea why. But this is a huge issue, leading to loss of entered data. It’s really frustrating to see your data behind a grey curtain knowing there is no way to retrieve it before having to reload the page and force yourself to have to enter it all over again. Is there at least some way we can dismiss the ‘Please Wait: Saving…’ dialog so that we can attempt a save at a later time or at least recover some of our data?

        I can confirm that i still have access to the server and the manager in another tab. I have also been able to save to this resource many times recently.

        @MokoJumbie

        MokoJumbie submitted:

        FYI, I noticed in this instance that upon attempting to save, I am getting the following error in my console:

        NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIDOMHTMLDocument.implementation]
        [Break On This Error]   
        ...xt():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o...
        http://mymodxwebsite.com/assets/components/tinymce/jscripts/tiny_mce/tiny_mce.js?v=225pl (line 1)
        uncaught exception: [object Object]
        

        l’ll report back if i see any other potential causes.

        @wm-simon

        Pfeifakopf submitted:

        I have the same Problem. This happens on multiple sites, if they where upgraded from an older version (< 2.1). Most times it happens in combination with MIGX and editing there something.

        This was referenced

        Nov 20, 2012

        @ghost

        Wanted to add a little more to this — we’re still experiencing this intermittently on a few sites being served from a couple of different server environments. The issue doesn’t seem to be tied to any particular browser, but what we’ve noted is that using Chrome or Safari’s built in developer tools, when we right-click and inspect the «Saving» overlay, by changing the element’s display to «none» we’re able to access the save button again — and clicking it again has worked 100% of the time.

        Obviously it’s not an optimal solution to pass on to our clients, but I’m curious if others are still experiencing this and whether this might narrow down the possible causes.

        @zaigham

        @BlueJayTech I would like to mention that you can use CTRL+S or CTRL+SHIFT+S (windows) as a shortcut to save the content. Not a solution but it will save you going into dev tools for the time being.

        IMO, most probably it is due to network going haywire for split second.

        @andrewcsp

        I just had this issue in MODX 2.4.2 on Firefox 42 and noticed that it coincided with a JS error in Firebug:

        uncaught exception: [object Object]
        domain.com/assets/components/tinymce/jscripts/tiny_mce/tiny_mce.js?v=242pl
        Line 1, col 118324
        

        Inspecting col 118324 in the minified JS file leads me to the statement o.cloneNode(true) in the following code fragment:

        if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}

        Looking at the unminified file, I believe this correlates to line 10336 of https://github.com/splittingred/TinyMCE/blob/develop/assets/components/tinymce/jscripts/tiny_mce/tiny_mce_src.js (node = node.cloneNode(true);

        ...
        
        // Return public methods
        return {
            schema : schema,
        
            addNodeFilter : htmlParser.addNodeFilter,
        
            addAttributeFilter : htmlParser.addAttributeFilter,
        
            onPreProcess : onPreProcess,
        
            onPostProcess : onPostProcess,
        
            serialize : function(node, args) {
                var impl, doc, oldDoc, htmlSerializer, content;
        
                // Explorer won't clone contents of script and style and the
                // selected index of select elements are cleared on a clone operation.
                if (isIE && dom.select('script,style,select,map').length > 0) {
                    content = node.innerHTML;
                    node = node.cloneNode(false);
                    dom.setHTML(node, content);
                } else
                    node = node.cloneNode(true);
        
        ...

        @pixelchutes

        Do you receive any kind of errors saving the same content when TinyMCE is not installed?

        @andrewcsp

        Unfortunately it appears to be an intermittent bug. I was updating a bunch of 10 documents and it happened about 4-5 times within 5 minutes. After that, no problems at all.

        I presume not using TinyMCE will fix the problem. Will try that the next time this problem surfaces.

        For what it’s worth, I don’t think the actual content within the TinyMCE editor is a factor (could be wrong of course). The documents contained one p tag containing 10-20 words. No links, tables, images, nothing fancy at all.

        @OptimusCrime

        I am going to close this for following reasons:

        • Original issue can deal with multiple underlying issues (see below list)
        • Some (sub)problems has to do with extras
        • No error log or extended information.

        The manager interface is heavily ajax-based, now, without inspecting the network data, a wide range of reason could prevent a resource from saving. These include (but not limited to): javascript errors (request is never sent), PHP error (fatal error resulting in invalid JSON response), web server error (apache/nginx fails to deliver response).

        Feel free to comment or reopen if you disagree with my decision.

        @modxbot close

        @xpix

        xpix created Redmine issue ID 3638

        Hi,

        From time to time the manager doesn’t save the document I just edited.
        The «Please Wait/Saving» overlay appears and stay there forever.

        If you just added content you cannot go back by pressing ESCAPE or by closing that overlay which means that you need to refresh the page.
        By refreshing the page the new content is lost.

        Please provide a way, a close button for now, that will close the overlay and allow users to re-save.
        When the overlay is closed by pressing the close button a message should appear and say «Your data has not been saved. Please try again. If this continues to happen save the data in a file on your computer, reload the page and re-paste the content».

        A better solution would be to implement a timer(configurable from settings) for the «Please Wait/Saving» message. If the document is not saved in 20 seconds you should alert the user to save the new content in a different format, reload and paste the content again and save.

        Currently I am not sure if this is a MODX only problem or maybe from time to time the host doesn’t properly answer to the MODX request but it never happen on Evo, and I know it happened in Revo in previous versions.

        I attached a screen-shot with my thoughts. I keep posting what I find but I suspect a js error.

        Thank you

        @splittingred

        splittingred submitted:

        Please do not assign target versions. Thanks.

        @MokoJumbie

        MokoJumbie submitted:

        Can somebody assign a target version to some of these super old major bugs? this is a serious bug which can result in a loss of data and is over 2 years old. There are a lot of really old issues which are being forgotten about and would really do to be resolved in new versions of MODX. I don’t know how to feel about requests to aid in finding new bugs to squash in upcoming releases when the old bugs are just getting buried.

        I can verify that this still exists in 2.2.5. If it helps, I believe it can be produced by having a connection drop before saving is completed. This is probably not the only cause, however.

        @opengeek

        opengeek submitted:

        I cannot reproduce this bug. I suspect this was related to mod_security rules applied in the server environment and preventing POST requests containing certain HTML tags or other content matching it’s filters.

        @MokoJumbie

        MokoJumbie submitted:

        I will try to look into this some more so I can give you more details.

        Your suspicion may be correct, but if so, I don’t believe mod_security is the culprit in at least some (if not most) of the cases I’ve seen. It has happened on several different servers and not consistently. Often the problem can be fixed by restarting the user’s browser or computer. Can someone corroborate this aspect of the bug for me?

        I think there are two issues here. First is the question of what’s causing the issue in the first place, which seems a bit ambiguous. But secondly, I don’t feel enough is being done by the manager to prevent submitted data from being lost should a request fail. Can a request which takes too long be canceled, notifying the user of the failure and allowing them the opportunity to save their entered content. Even better would be to save the submission content in sessionStorage or localStorage for recovery in the event of such a failure.

        Thanks for looking into this.

        @MokoJumbie

        MokoJumbie submitted:

        Still looking into this, but forcibly attempting to remove access to the server during a save yields the results seen in Issue #9147, not the result seen in this bug. Anyone have any luck in reliably reproducing this?

        @MokoJumbie

        MokoJumbie submitted:

        I just got this bug again. No idea why. But this is a huge issue, leading to loss of entered data. It’s really frustrating to see your data behind a grey curtain knowing there is no way to retrieve it before having to reload the page and force yourself to have to enter it all over again. Is there at least some way we can dismiss the ‘Please Wait: Saving…’ dialog so that we can attempt a save at a later time or at least recover some of our data?

        I can confirm that i still have access to the server and the manager in another tab. I have also been able to save to this resource many times recently.

        @MokoJumbie

        MokoJumbie submitted:

        FYI, I noticed in this instance that upon attempting to save, I am getting the following error in my console:

        NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIDOMHTMLDocument.implementation]
        [Break On This Error]   
        ...xt():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o...
        http://mymodxwebsite.com/assets/components/tinymce/jscripts/tiny_mce/tiny_mce.js?v=225pl (line 1)
        uncaught exception: [object Object]
        

        l’ll report back if i see any other potential causes.

        @wm-simon

        Pfeifakopf submitted:

        I have the same Problem. This happens on multiple sites, if they where upgraded from an older version (< 2.1). Most times it happens in combination with MIGX and editing there something.

        This was referenced

        Nov 20, 2012

        @ghost

        Wanted to add a little more to this — we’re still experiencing this intermittently on a few sites being served from a couple of different server environments. The issue doesn’t seem to be tied to any particular browser, but what we’ve noted is that using Chrome or Safari’s built in developer tools, when we right-click and inspect the «Saving» overlay, by changing the element’s display to «none» we’re able to access the save button again — and clicking it again has worked 100% of the time.

        Obviously it’s not an optimal solution to pass on to our clients, but I’m curious if others are still experiencing this and whether this might narrow down the possible causes.

        @zaigham

        @BlueJayTech I would like to mention that you can use CTRL+S or CTRL+SHIFT+S (windows) as a shortcut to save the content. Not a solution but it will save you going into dev tools for the time being.

        IMO, most probably it is due to network going haywire for split second.

        @andrewcsp

        I just had this issue in MODX 2.4.2 on Firefox 42 and noticed that it coincided with a JS error in Firebug:

        uncaught exception: [object Object]
        domain.com/assets/components/tinymce/jscripts/tiny_mce/tiny_mce.js?v=242pl
        Line 1, col 118324
        

        Inspecting col 118324 in the minified JS file leads me to the statement o.cloneNode(true) in the following code fragment:

        if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}

        Looking at the unminified file, I believe this correlates to line 10336 of https://github.com/splittingred/TinyMCE/blob/develop/assets/components/tinymce/jscripts/tiny_mce/tiny_mce_src.js (node = node.cloneNode(true);

        ...
        
        // Return public methods
        return {
            schema : schema,
        
            addNodeFilter : htmlParser.addNodeFilter,
        
            addAttributeFilter : htmlParser.addAttributeFilter,
        
            onPreProcess : onPreProcess,
        
            onPostProcess : onPostProcess,
        
            serialize : function(node, args) {
                var impl, doc, oldDoc, htmlSerializer, content;
        
                // Explorer won't clone contents of script and style and the
                // selected index of select elements are cleared on a clone operation.
                if (isIE && dom.select('script,style,select,map').length > 0) {
                    content = node.innerHTML;
                    node = node.cloneNode(false);
                    dom.setHTML(node, content);
                } else
                    node = node.cloneNode(true);
        
        ...

        @pixelchutes

        Do you receive any kind of errors saving the same content when TinyMCE is not installed?

        @andrewcsp

        Unfortunately it appears to be an intermittent bug. I was updating a bunch of 10 documents and it happened about 4-5 times within 5 minutes. After that, no problems at all.

        I presume not using TinyMCE will fix the problem. Will try that the next time this problem surfaces.

        For what it’s worth, I don’t think the actual content within the TinyMCE editor is a factor (could be wrong of course). The documents contained one p tag containing 10-20 words. No links, tables, images, nothing fancy at all.

        @OptimusCrime

        I am going to close this for following reasons:

        • Original issue can deal with multiple underlying issues (see below list)
        • Some (sub)problems has to do with extras
        • No error log or extended information.

        The manager interface is heavily ajax-based, now, without inspecting the network data, a wide range of reason could prevent a resource from saving. These include (but not limited to): javascript errors (request is never sent), PHP error (fatal error resulting in invalid JSON response), web server error (apache/nginx fails to deliver response).

        Feel free to comment or reopen if you disagree with my decision.

        @modxbot close

        Большой объем кода — ошибка.

        Login to Post

          • 36423

          • 2 Posts
          • Send PM

          cratte Reply #1, 11 years, 7 months ago

          Здравствуйте.
          При добавлении большого объема информации на новый ресурс modx 2.1.3 выдает ошибку: Произошла ошибка при попытке сохранить ресурс.
          Та же история с чанками и снипетами: если кода много, то выдается ошибка. Modx evo 1.0.0-RC3 c этим объемами справляется «на ура».
          В чем может быть проблема? Это связано с CMS или может в базе нужно какие настройки поменять?

            • 36423

            • 2 Posts
            • Send PM

            cratte Reply #2, 11 years, 7 months ago

            Проблема снята, дела было в настройках базы.

            Помогаю со студенческими работами здесь

            211 строка
            Всем привет. Тут такое дело. Формируется регламентированный отчёт РСВ в ПФР. И у нас для одного…

            Почему printf() выводит в экспоненциальной нотации число 1,581010e-322?
            #include &lt;iostream&gt;
            using namespace std;

            int main()
            {
            setlocale(LC_ALL, &quot;ru&quot;);

            CANON MFY 211
            Нужна помощь CANON MFY 211 катридж 737 пишет рекомендуем подготовить катридж, я уже засыпал тонер…

            Есть файл ресурсов. В ресурс загрузил картинку. Как программно добавить в ресурс файл?
            $R New1.res…button1.click…
            Var my1:TBitMap;
            Res:TResourceStream;
            begin

            гладильная система Hansa HB-211 не включается, гладильная система Hansa HB-211 не включается
            гладильная система Hansa HB-211 при включении может щелкать релюшкой ,в динамике что то трещит ,…

            Konica Minolta bizhub 211 формат бумаги
            Как поменять формат бумаги: в нижний ящик поставить А4, а в верхний А3?
            лазил по менюхам нигде нет…

            Искать еще темы с ответами

            Или воспользуйтесь поиском по форуму:

            Бесконечное сохранение ресурсов в MODX


            27 августа 2018, 22:49

              
            Alex

            MODX Revo

            0

              
            3731





            0



            Недавно возникла проблема в админке MODX при редактированиии и создании нового ресурса.
            При нажатии на кнопку «сохранить», — ресурс начинал бесконечно его сохранять и в консоли вываливались ошибки:

            Uncaught SyntaxError: Unexpected identifier
                at doDecode (ext-all.js:21)
                at Object.decode (ext-all.js:21)
                at Ext.form.Action.Submit.handleResponse (modx.jsgrps-min.js:1)
                at Ext.form.Action.Submit.processResponse (ext-all.js:21)
                at Ext.form.Action.Submit.success (ext-all.js:21)
                at o (ext-all.js:21)
                at Ext.data.Connection.s (ext-all.js:21)
                at HTMLIFrameElement.I (ext-all.js:21)
            

            Проблема была в браузере, а не самом MODX. В Opere всё работало отлично, а в Chrome админка начинала вести себя капризно.

            Бесконечное сохранение ресурсов в MODX

            красная пунктирная линия

            Решение проблемы

            Оказалось, это был просто конфликт с расширением в Chrome под названием «MusVK». Достаточно его отключить и работа сайта нормализуется.


            Поделиться с друзьями


            Похожие статьи:

            MODX ➨ условия if-else
            MODX Shopkeeper 3 — проблема с плагином мультивалютности
            Tickets: как сделать счетчик просмотров всех посетителей
            Правильный файл robots.txt для CMS MODX Revolution
            Правильный файл .htaccess для CMS MODX Revolution

            Комментарии ()


            1. Григорий Komsomol
              13 октября 2018, 12:38
              #



              +1







              Спасибо! Ваша инструкция сэкономила много времени!


              1. Алексей Власов
                13 октября 2018, 18:57
                #




                0







                Спасибо за комментарий! Рад, что помог!

              Вы должны авторизоваться, чтобы оставлять комментарии.

              Вы можете авторизоваться на сайте через:

              YandexVkontakte

              Relevant error:

              [2019-09-26 12:12:14] (ERROR @ C:laragonwwwcoresrcRevolutionmodUserProfile.php : 57) Error HY000 executing statement:
              INSERT INTO `modx_user_attributes` (`internalKey`, `fullname`, `email`, `phone`, `mobilephone`, `blocked`, `blockeduntil`, `blockedafter`, `logincount`, `lastlogin`, `thislogin`, `failedlogincount`, `sessionid`, `dob`, `gender`, `address`, `country`, `city`, `state`, `zip`, `fax`, `photo`, `comment`, `website`) VALUES (1, 'Администратор по умолчанию', 'ivanx86@gmail.com', '', '', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', '', '', '', '', '', '', '', '')
              Array
              (
                  [0] => HY000
                  [1] => 1366
                  [2] => Incorrect string value: 'xD0x90xD0xB4xD0xBC...' for column 'fullname' at row 1
              )
              

              Looks like the database/table wasn’t created as UTF8.

              Совсем недавно Сергей Прохоров ака proxyfabio написал статью Валидация объектов + транзакции. Немного эта тема обсуждалась здесь. От себя хочу добавить, что эта тема крайне важная, и на сегодня это одна из самых главных проблем в разработке крупных проектов на MODX Revolution.

              Здесь сразу попрошу не начинать ничего вроде «Если делаете крупные проекты, не надо их делать на MODX, возьмите бла-бла-бла». Мы делали крупные проекты, и не только на MODX. На MODX вполне можно делать крупные проекты, и на сегодня есть всего лишь пара слабых мест, которые мы правим на индивидуальных проектах, в остальном же MODX на 98% пригоден для разработки крупных проектов.

              Итак, одна из этих серьезных проблем связана именно с методом xPDOObject::save() (вызываемая при сохранении xPDO-объектов). Суть этой проблемы в том, что внутри него срабатывает метод сохранения связанных объектов xPDOObject::_saveRelatedObjects() дважды. Раз и два. Делается это для того, чтобы выставить первичные и вторичные ключи для этих связанных объектов (см. справочный материал от Ильи Уткина). Объясню подробней на примере. Вот код:

              <?php
              $user_data = array(
                  "username"  => "test",
              );
              
              $profile_data = array();
              
              $user = $modx->newObject('modUser', $user_data);
              $user->Profile = $modx->newObject('modUserProfile', $profile_data);
              $user->save();
              
              print '<pre>';
              print_r($user->toArray());
              print_r($user->Profile->toArray());
              

              В целом наверняка суть этого кода понятна многим, но давайте сосредоточимся на деталях. Когда мы создали два новых объекта ($user и $user->Profile), у них еще нет айдишников, пока их не сохранили. Но сохранив только объект $user, мы на выходе получаем и сохраненный объект $user->Profile. Это как бы тоже понятно почему, Илья в своей статье все это описывает. Но вопрос, который не совсем на виду болтается — это «как xPDO „знает“ какой id у объекта $user, чтобы назначить этот id в качестве $modx->Profile->internalKey?». Для этого давайте опять-таки пробежимся по коду метода xPDO::save();

              Вот у нас первый вызов метода $user->_saveRelatedObjects(). В этот момент объект $user еще не сохранен (не записан в базу), id-шника у него еще нет. $user->Profile тоже не сохранен и не имеет ни id, ни internalKey. Переходя к вызову метода $user->_saveRelatedObjects(), мы видим, что идет перебор связанных объектов и их сохранение (метод xPDO::_saveRelatedObject()). Здесь я еще раз уточню, что сохраняем мы объект $user, для которого объект $user->Profile является связанным. И вот здесь-то и получается, что фактически объект $user->Profile сохранится раньше, чем объект $user. Почему? Потому что в вызове $user->_saveRelatedObject($user->Profile) будет вызван метод $user->Profile->save(), а так как в текущий момент для $user->Profile нет связанных объектов, то он будет записан в базу данных. И что у нас здесь получается? $user->Profile уже сохранен и у него есть свой id, но id нет у объекта $user (потому что он еще не был сохранен). По этой причине и вторичный ключ $user->Profile->internalKey все еще пустой.

              ОК, с этим разобрались, едем дальше. А дальше у нас идет сохранение уже самого объекта $user с записью его в БД и присвоением ему id. Все, запись сделана. Вот теперь у нас у обоих объектов есть эти id-шники, но все еще нет значения $user->Profile->internalKey. Вот как раз для этого и вызывается метод $user->_saveRelatedObjects() еще раз. Теперь, когда будет сохраняться связанный объект $user->Profile, он сможет получить значение $user->id и присвоить его в качестве $user->Profile->internalKey и сохраниться.

              Да, я согласен, что все это очень запутанно (а объясняю это еще запутанней), но логика во всем этом есть. И, собственно, именно по этой причине я вижу такое упорное использование MyIsam вместо innoDB. Почему? Да потому что на innoDB это просто не сможет полноценно работать. И вот как раз сейчас мы разберем имеющуюся проблему, а не сам принцип работы. Сразу скажу, что для полного понимания всего этого требуется хорошее понимание MySQL, а именно понимание транзакций, primary и foreign key и т.п.

              Давайте настроим нашу базу данных еще правильней, а именно настроим первичные и вторичные ключи на уровне самой базы. Для этого выполним следующее:

              1. Переведем таблицы на движок innoDB.

              2. В таблице modx_users поле id int(10)unsigned, а в modx_users_attributes поле internalKey int(10) (не unsigned). Из-за этого мы просто не сможем настроить вторичный ключ, ибо типы данных в колонках обеих таблиц обязаны полностью совпадать.

              Меняем на unsigned

              3 Создаем вторичный ключ

              Если при сохранении вторичного ключа вы не получили никаких ошибок, то замечательно! Но есть несколько ошибок, которые вы можете получить. Самые распространенные из них:
              1. Типы данных не совпадают.
              2. Для вторичной записи не существует первичной (то есть, к примеру, у вас есть запись в modx_user_attributes с internalKey = 5, а записи в modx_users с id = 5 нету).

              А теперь давайте посмотрим суть проблемы на примере. Для этого выполним в консоли следующий код:

              
              <?php
              
              $user_data = array(
                  "username"  => "test_". rand(1,100000),
              );
              
              $profile_data = array(
                  "email" => "test@local.host",
              );
              
              $user = $modx->newObject('modUser', $user_data);
              $user->Profile = $modx->newObject('modUserProfile', $profile_data);
              
              $user->save();
              
              print '<pre>';
              print_r($user->toArray());
              print_r($user->Profile->toArray());
              

              Сейчас мы никакой проблемы не увидели, все сохранилось без замечаний.

              Примерный вывод при успешном выполнении

              
              Array
              (
                  [id] => 59
                  [username] => test_65309
                  [password] => 
                  [cachepwd] => 
                  [class_key] => modUser
                  [active] => 1
                  [remote_key] => 
                  [remote_data] => 
                  [hash_class] => hashing.modPBKDF2
                  [salt] => 
                  [primary_group] => 0
                  [session_stale] => 
                  [sudo] => 
              )
              Array
              (
                  [id] => 54
                  [internalKey] => 59
                  [fullname] => 
                  [email] => test@local.host
                  [phone] => 
                  [mobilephone] => 
                  [blocked] => 
                  [blockeduntil] => 0
                  [blockedafter] => 0
                  [logincount] => 0
                  [lastlogin] => 0
                  [thislogin] => 0
                  [failedlogincount] => 0
                  [sessionid] => 
                  [dob] => 0
                  [gender] => 0
                  [address] => 
                  [country] => 
                  [city] => 
                  [state] => 
                  [zip] => 
                  [fax] => 
                  [photo] => 
                  [comment] => 
                  [website] => 
                  [extended] => 
              )
              

              А теперь немного изменим наш код:

              
              <?php
              
              $user_data = array(
                  "username"  => "test_". rand(1,100000),
              );
              
              $profile_data = array(
                  "email" => "test@local.host",
              );
              
              $user = $modx->newObject('modUser', $user_data);
              $user->Profile = $modx->newObject('modUserProfile', $profile_data);
              
              // Заранее установим id первичному объекту. Здесь следует указать свой какой-нибудь id, убедившись, что в БД он не занят.
              $user->id = 40;
              
              $user->save();
              
              print '<pre>';
              print_r($user->toArray());
              print_r($user->Profile->toArray());
              

              Что мы теперь получим при выполнении этого кода?

              1. Сообщение об SQL-ошибке

              
              Array
              (
                  [0] => 23000
                  [1] => 1452
                  [2] => Cannot add or update a child row: a foreign key constraint fails (`shopmodxbox_test2`.`modx_user_attributes`, CONSTRAINT `modx_user_attributes_ibfk_1` FOREIGN KEY (`internalKey`) REFERENCES `modx_users` (`id`))
              )
              

              2. Оба наши объекта все-таки сохранились и имеют корректные id и internalKey.

              Почему так происходит? При сохранении вторичного объекта xPDO проверяет имеется ли значение первичного ключа, и только если он есть, тогда уже устанавливает его значение в качестве вторичного ключа и сохраняет этот объект. В нашем случае мы вручную указали первичный ключ id и вторичный объект сумел получить его значение и попытался записаться в базу данных, но так как фактически первичной записи там нет, мы и получаем SQL-ошибку о невозможности записать вторичную запись без первичного объекта. Но сохранение первичного объекта на этом не прерывается. После этого первичный объект $user успешно записывается в базу, а при повторной попытке сохранения связанного объекта $user->Profile уже нормально все сохраняется, так как первичная запись имеется.

              Из всего этого вытекает два заключения.

              1. При сохранении связанных объектов невозможно отследить ошибки сохранения вторичных объектов и как-то на них среагировать. То есть никогда нельзя с уверенностью сказать, по какой причине не был сохранен вторичный объект (то ли нет пока первичного объекта, и он сможет позже записаться при повторном вызове метода xPDOObject::_saveRelatedObjects(), то ли там какой-нибудь уникальный ключ сконфликтовал и запись в принципе не может быть записана, то ли там валидация на уровне мапы не прошла и т.д. и т.п.).

              2. По этой причине невозможно использовать полноценно транзакции.

              Возможный путь решения этой проблемы.

              Мы видим решение этой проблемы в том, чтобы разграничить первый и второй вызов метода xPDOObject::_saveRelatedObjects() по типам связанных объектов, а именно первый вызов — для первичных объектов, а второй вызов — для вторичных. В таком случае точно не будет путаницы с ключами, и если объект по какой-то причине не сохранился, то это точно будет означать ошибку и можно будет выполнять прерывание процесса сохранения (в том числе и откат транзакций).

              Большой объем кода — ошибка.

              Subscribe: RSS

              Login to Post

                • 36423

                • 2 Posts
                • Send PM

                cratte Reply #1, 11 years, 5 months ago

                Здравствуйте.
                При добавлении большого объема информации на новый ресурс modx 2.1.3 выдает ошибку: Произошла ошибка при попытке сохранить ресурс.
                Та же история с чанками и снипетами: если кода много, то выдается ошибка. Modx evo 1.0.0-RC3 c этим объемами справляется «на ура».
                В чем может быть проблема? Это связано с CMS или может в базе нужно какие настройки поменять?

                  • 36423

                  • 2 Posts
                  • Send PM

                  cratte Reply #2, 11 years, 5 months ago

                  Проблема снята, дела было в настройках базы.

                  Бесконечное сохранение ресурсов в MODX


                  27 августа 2018, 22:49

                    
                  Alex


                  MODX Revo

                  0

                    
                  3590






                  0



                  Недавно возникла проблема в админке MODX при редактированиии и создании нового ресурса.
                  При нажатии на кнопку «сохранить», — ресурс начинал бесконечно его сохранять и в консоли вываливались ошибки:

                  Uncaught SyntaxError: Unexpected identifier
                      at doDecode (ext-all.js:21)
                      at Object.decode (ext-all.js:21)
                      at Ext.form.Action.Submit.handleResponse (modx.jsgrps-min.js:1)
                      at Ext.form.Action.Submit.processResponse (ext-all.js:21)
                      at Ext.form.Action.Submit.success (ext-all.js:21)
                      at o (ext-all.js:21)
                      at Ext.data.Connection.s (ext-all.js:21)
                      at HTMLIFrameElement.I (ext-all.js:21)
                  

                  Проблема была в браузере, а не самом MODX. В Opere всё работало отлично, а в Chrome админка начинала вести себя капризно.

                  Бесконечное сохранение ресурсов в MODX

                  красная пунктирная линия

                  Решение проблемы

                  Оказалось, это был просто конфликт с расширением в Chrome под названием «MusVK». Достаточно его отключить и работа сайта нормализуется.


                  Поделиться с друзьями


                  Похожие статьи:

                  MODX ➨ условия if-else
                  MODX Shopkeeper 3 — проблема с плагином мультивалютности
                  Tickets: как сделать счетчик просмотров всех посетителей
                  Правильный файл robots.txt для CMS MODX Revolution
                  Правильный файл .htaccess для CMS MODX Revolution

                  Комментарии ()


                  1. Григорий Komsomol
                    13 октября 2018, 12:38
                    #



                    +1







                    Спасибо! Ваша инструкция сэкономила много времени!


                    1. Алексей Власов
                      13 октября 2018, 18:57
                      #




                      0







                      Спасибо за комментарий! Рад, что помог!

                    Вы должны авторизоваться, чтобы оставлять комментарии.

                    Вы можете авторизоваться на сайте через:

                    YandexVkontakte

                    @xpix

                    xpix created Redmine issue ID 3638

                    Hi,

                    From time to time the manager doesn’t save the document I just edited.
                    The «Please Wait/Saving» overlay appears and stay there forever.

                    If you just added content you cannot go back by pressing ESCAPE or by closing that overlay which means that you need to refresh the page.
                    By refreshing the page the new content is lost.

                    Please provide a way, a close button for now, that will close the overlay and allow users to re-save.
                    When the overlay is closed by pressing the close button a message should appear and say «Your data has not been saved. Please try again. If this continues to happen save the data in a file on your computer, reload the page and re-paste the content».

                    A better solution would be to implement a timer(configurable from settings) for the «Please Wait/Saving» message. If the document is not saved in 20 seconds you should alert the user to save the new content in a different format, reload and paste the content again and save.

                    Currently I am not sure if this is a MODX only problem or maybe from time to time the host doesn’t properly answer to the MODX request but it never happen on Evo, and I know it happened in Revo in previous versions.

                    I attached a screen-shot with my thoughts. I keep posting what I find but I suspect a js error.

                    Thank you

                    @splittingred

                    splittingred submitted:

                    Please do not assign target versions. Thanks.

                    @MokoJumbie

                    MokoJumbie submitted:

                    Can somebody assign a target version to some of these super old major bugs? this is a serious bug which can result in a loss of data and is over 2 years old. There are a lot of really old issues which are being forgotten about and would really do to be resolved in new versions of MODX. I don’t know how to feel about requests to aid in finding new bugs to squash in upcoming releases when the old bugs are just getting buried.

                    I can verify that this still exists in 2.2.5. If it helps, I believe it can be produced by having a connection drop before saving is completed. This is probably not the only cause, however.

                    @opengeek

                    opengeek submitted:

                    I cannot reproduce this bug. I suspect this was related to mod_security rules applied in the server environment and preventing POST requests containing certain HTML tags or other content matching it’s filters.

                    @MokoJumbie

                    MokoJumbie submitted:

                    I will try to look into this some more so I can give you more details.

                    Your suspicion may be correct, but if so, I don’t believe mod_security is the culprit in at least some (if not most) of the cases I’ve seen. It has happened on several different servers and not consistently. Often the problem can be fixed by restarting the user’s browser or computer. Can someone corroborate this aspect of the bug for me?

                    I think there are two issues here. First is the question of what’s causing the issue in the first place, which seems a bit ambiguous. But secondly, I don’t feel enough is being done by the manager to prevent submitted data from being lost should a request fail. Can a request which takes too long be canceled, notifying the user of the failure and allowing them the opportunity to save their entered content. Even better would be to save the submission content in sessionStorage or localStorage for recovery in the event of such a failure.

                    Thanks for looking into this.

                    @MokoJumbie

                    MokoJumbie submitted:

                    Still looking into this, but forcibly attempting to remove access to the server during a save yields the results seen in Issue #9147, not the result seen in this bug. Anyone have any luck in reliably reproducing this?

                    @MokoJumbie

                    MokoJumbie submitted:

                    I just got this bug again. No idea why. But this is a huge issue, leading to loss of entered data. It’s really frustrating to see your data behind a grey curtain knowing there is no way to retrieve it before having to reload the page and force yourself to have to enter it all over again. Is there at least some way we can dismiss the ‘Please Wait: Saving…’ dialog so that we can attempt a save at a later time or at least recover some of our data?

                    I can confirm that i still have access to the server and the manager in another tab. I have also been able to save to this resource many times recently.

                    @MokoJumbie

                    MokoJumbie submitted:

                    FYI, I noticed in this instance that upon attempting to save, I am getting the following error in my console:

                    NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIDOMHTMLDocument.implementation]
                    [Break On This Error]   
                    ...xt():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o...
                    http://mymodxwebsite.com/assets/components/tinymce/jscripts/tiny_mce/tiny_mce.js?v=225pl (line 1)
                    uncaught exception: [object Object]
                    

                    l’ll report back if i see any other potential causes.

                    @wm-simon

                    Pfeifakopf submitted:

                    I have the same Problem. This happens on multiple sites, if they where upgraded from an older version (< 2.1). Most times it happens in combination with MIGX and editing there something.

                    This was referenced

                    Nov 20, 2012

                    @ghost

                    Wanted to add a little more to this — we’re still experiencing this intermittently on a few sites being served from a couple of different server environments. The issue doesn’t seem to be tied to any particular browser, but what we’ve noted is that using Chrome or Safari’s built in developer tools, when we right-click and inspect the «Saving» overlay, by changing the element’s display to «none» we’re able to access the save button again — and clicking it again has worked 100% of the time.

                    Obviously it’s not an optimal solution to pass on to our clients, but I’m curious if others are still experiencing this and whether this might narrow down the possible causes.

                    @zaigham

                    @BlueJayTech I would like to mention that you can use CTRL+S or CTRL+SHIFT+S (windows) as a shortcut to save the content. Not a solution but it will save you going into dev tools for the time being.

                    IMO, most probably it is due to network going haywire for split second.

                    @andrewcsp

                    I just had this issue in MODX 2.4.2 on Firefox 42 and noticed that it coincided with a JS error in Firebug:

                    uncaught exception: [object Object]
                    domain.com/assets/components/tinymce/jscripts/tiny_mce/tiny_mce.js?v=242pl
                    Line 1, col 118324
                    

                    Inspecting col 118324 in the minified JS file leads me to the statement o.cloneNode(true) in the following code fragment:

                    if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}

                    Looking at the unminified file, I believe this correlates to line 10336 of https://github.com/splittingred/TinyMCE/blob/develop/assets/components/tinymce/jscripts/tiny_mce/tiny_mce_src.js (node = node.cloneNode(true);

                    ...
                    
                    // Return public methods
                    return {
                        schema : schema,
                    
                        addNodeFilter : htmlParser.addNodeFilter,
                    
                        addAttributeFilter : htmlParser.addAttributeFilter,
                    
                        onPreProcess : onPreProcess,
                    
                        onPostProcess : onPostProcess,
                    
                        serialize : function(node, args) {
                            var impl, doc, oldDoc, htmlSerializer, content;
                    
                            // Explorer won't clone contents of script and style and the
                            // selected index of select elements are cleared on a clone operation.
                            if (isIE && dom.select('script,style,select,map').length > 0) {
                                content = node.innerHTML;
                                node = node.cloneNode(false);
                                dom.setHTML(node, content);
                            } else
                                node = node.cloneNode(true);
                    
                    ...

                    @pixelchutes

                    Do you receive any kind of errors saving the same content when TinyMCE is not installed?

                    @andrewcsp

                    Unfortunately it appears to be an intermittent bug. I was updating a bunch of 10 documents and it happened about 4-5 times within 5 minutes. After that, no problems at all.

                    I presume not using TinyMCE will fix the problem. Will try that the next time this problem surfaces.

                    For what it’s worth, I don’t think the actual content within the TinyMCE editor is a factor (could be wrong of course). The documents contained one p tag containing 10-20 words. No links, tables, images, nothing fancy at all.

                    @OptimusCrime

                    I am going to close this for following reasons:

                    • Original issue can deal with multiple underlying issues (see below list)
                    • Some (sub)problems has to do with extras
                    • No error log or extended information.

                    The manager interface is heavily ajax-based, now, without inspecting the network data, a wide range of reason could prevent a resource from saving. These include (but not limited to): javascript errors (request is never sent), PHP error (fatal error resulting in invalid JSON response), web server error (apache/nginx fails to deliver response).

                    Feel free to comment or reopen if you disagree with my decision.

                    @modxbot close

                    @xpix

                    xpix created Redmine issue ID 3638

                    Hi,

                    From time to time the manager doesn’t save the document I just edited.
                    The «Please Wait/Saving» overlay appears and stay there forever.

                    If you just added content you cannot go back by pressing ESCAPE or by closing that overlay which means that you need to refresh the page.
                    By refreshing the page the new content is lost.

                    Please provide a way, a close button for now, that will close the overlay and allow users to re-save.
                    When the overlay is closed by pressing the close button a message should appear and say «Your data has not been saved. Please try again. If this continues to happen save the data in a file on your computer, reload the page and re-paste the content».

                    A better solution would be to implement a timer(configurable from settings) for the «Please Wait/Saving» message. If the document is not saved in 20 seconds you should alert the user to save the new content in a different format, reload and paste the content again and save.

                    Currently I am not sure if this is a MODX only problem or maybe from time to time the host doesn’t properly answer to the MODX request but it never happen on Evo, and I know it happened in Revo in previous versions.

                    I attached a screen-shot with my thoughts. I keep posting what I find but I suspect a js error.

                    Thank you

                    @splittingred

                    splittingred submitted:

                    Please do not assign target versions. Thanks.

                    @MokoJumbie

                    MokoJumbie submitted:

                    Can somebody assign a target version to some of these super old major bugs? this is a serious bug which can result in a loss of data and is over 2 years old. There are a lot of really old issues which are being forgotten about and would really do to be resolved in new versions of MODX. I don’t know how to feel about requests to aid in finding new bugs to squash in upcoming releases when the old bugs are just getting buried.

                    I can verify that this still exists in 2.2.5. If it helps, I believe it can be produced by having a connection drop before saving is completed. This is probably not the only cause, however.

                    @opengeek

                    opengeek submitted:

                    I cannot reproduce this bug. I suspect this was related to mod_security rules applied in the server environment and preventing POST requests containing certain HTML tags or other content matching it’s filters.

                    @MokoJumbie

                    MokoJumbie submitted:

                    I will try to look into this some more so I can give you more details.

                    Your suspicion may be correct, but if so, I don’t believe mod_security is the culprit in at least some (if not most) of the cases I’ve seen. It has happened on several different servers and not consistently. Often the problem can be fixed by restarting the user’s browser or computer. Can someone corroborate this aspect of the bug for me?

                    I think there are two issues here. First is the question of what’s causing the issue in the first place, which seems a bit ambiguous. But secondly, I don’t feel enough is being done by the manager to prevent submitted data from being lost should a request fail. Can a request which takes too long be canceled, notifying the user of the failure and allowing them the opportunity to save their entered content. Even better would be to save the submission content in sessionStorage or localStorage for recovery in the event of such a failure.

                    Thanks for looking into this.

                    @MokoJumbie

                    MokoJumbie submitted:

                    Still looking into this, but forcibly attempting to remove access to the server during a save yields the results seen in Issue #9147, not the result seen in this bug. Anyone have any luck in reliably reproducing this?

                    @MokoJumbie

                    MokoJumbie submitted:

                    I just got this bug again. No idea why. But this is a huge issue, leading to loss of entered data. It’s really frustrating to see your data behind a grey curtain knowing there is no way to retrieve it before having to reload the page and force yourself to have to enter it all over again. Is there at least some way we can dismiss the ‘Please Wait: Saving…’ dialog so that we can attempt a save at a later time or at least recover some of our data?

                    I can confirm that i still have access to the server and the manager in another tab. I have also been able to save to this resource many times recently.

                    @MokoJumbie

                    MokoJumbie submitted:

                    FYI, I noticed in this instance that upon attempting to save, I am getting the following error in my console:

                    NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIDOMHTMLDocument.implementation]
                    [Break On This Error]   
                    ...xt():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o...
                    http://mymodxwebsite.com/assets/components/tinymce/jscripts/tiny_mce/tiny_mce.js?v=225pl (line 1)
                    uncaught exception: [object Object]
                    

                    l’ll report back if i see any other potential causes.

                    @wm-simon

                    Pfeifakopf submitted:

                    I have the same Problem. This happens on multiple sites, if they where upgraded from an older version (< 2.1). Most times it happens in combination with MIGX and editing there something.

                    This was referenced

                    Nov 20, 2012

                    @ghost

                    Wanted to add a little more to this — we’re still experiencing this intermittently on a few sites being served from a couple of different server environments. The issue doesn’t seem to be tied to any particular browser, but what we’ve noted is that using Chrome or Safari’s built in developer tools, when we right-click and inspect the «Saving» overlay, by changing the element’s display to «none» we’re able to access the save button again — and clicking it again has worked 100% of the time.

                    Obviously it’s not an optimal solution to pass on to our clients, but I’m curious if others are still experiencing this and whether this might narrow down the possible causes.

                    @zaigham

                    @BlueJayTech I would like to mention that you can use CTRL+S or CTRL+SHIFT+S (windows) as a shortcut to save the content. Not a solution but it will save you going into dev tools for the time being.

                    IMO, most probably it is due to network going haywire for split second.

                    @andrewcsp

                    I just had this issue in MODX 2.4.2 on Firefox 42 and noticed that it coincided with a JS error in Firebug:

                    uncaught exception: [object Object]
                    domain.com/assets/components/tinymce/jscripts/tiny_mce/tiny_mce.js?v=242pl
                    Line 1, col 118324
                    

                    Inspecting col 118324 in the minified JS file leads me to the statement o.cloneNode(true) in the following code fragment:

                    if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}

                    Looking at the unminified file, I believe this correlates to line 10336 of https://github.com/splittingred/TinyMCE/blob/develop/assets/components/tinymce/jscripts/tiny_mce/tiny_mce_src.js (node = node.cloneNode(true);

                    ...
                    
                    // Return public methods
                    return {
                        schema : schema,
                    
                        addNodeFilter : htmlParser.addNodeFilter,
                    
                        addAttributeFilter : htmlParser.addAttributeFilter,
                    
                        onPreProcess : onPreProcess,
                    
                        onPostProcess : onPostProcess,
                    
                        serialize : function(node, args) {
                            var impl, doc, oldDoc, htmlSerializer, content;
                    
                            // Explorer won't clone contents of script and style and the
                            // selected index of select elements are cleared on a clone operation.
                            if (isIE && dom.select('script,style,select,map').length > 0) {
                                content = node.innerHTML;
                                node = node.cloneNode(false);
                                dom.setHTML(node, content);
                            } else
                                node = node.cloneNode(true);
                    
                    ...

                    @pixelchutes

                    Do you receive any kind of errors saving the same content when TinyMCE is not installed?

                    @andrewcsp

                    Unfortunately it appears to be an intermittent bug. I was updating a bunch of 10 documents and it happened about 4-5 times within 5 minutes. After that, no problems at all.

                    I presume not using TinyMCE will fix the problem. Will try that the next time this problem surfaces.

                    For what it’s worth, I don’t think the actual content within the TinyMCE editor is a factor (could be wrong of course). The documents contained one p tag containing 10-20 words. No links, tables, images, nothing fancy at all.

                    @OptimusCrime

                    I am going to close this for following reasons:

                    • Original issue can deal with multiple underlying issues (see below list)
                    • Some (sub)problems has to do with extras
                    • No error log or extended information.

                    The manager interface is heavily ajax-based, now, without inspecting the network data, a wide range of reason could prevent a resource from saving. These include (but not limited to): javascript errors (request is never sent), PHP error (fatal error resulting in invalid JSON response), web server error (apache/nginx fails to deliver response).

                    Feel free to comment or reopen if you disagree with my decision.

                    @modxbot close

                    Большой объем кода — ошибка.

                    Subscribe: RSS

                    Login to Post

                      • 36423

                      • 2 Posts
                      • Send PM

                      cratte Reply #1, 11 years, 10 months ago

                      Здравствуйте.
                      При добавлении большого объема информации на новый ресурс modx 2.1.3 выдает ошибку: Произошла ошибка при попытке сохранить ресурс.
                      Та же история с чанками и снипетами: если кода много, то выдается ошибка. Modx evo 1.0.0-RC3 c этим объемами справляется «на ура».
                      В чем может быть проблема? Это связано с CMS или может в базе нужно какие настройки поменять?

                        • 36423

                        • 2 Posts
                        • Send PM

                        cratte Reply #2, 11 years, 10 months ago

                        Проблема снята, дела было в настройках базы.

                      • Произошла ошибка при попытке сохранить поставщика
                      • Произошла ошибка при попытке создания папки c users public documents ascon
                      • Произошла ошибка при попытке создания отчета оператор или администратор отклонили запрос
                      • Произошла ошибка при попытке создания контрольных точек выбранных виртуальных машин
                      • Произошла ошибка при попытке получения списка виртуальных коммутаторов