How to save FormView file in Odoo 10 after get an error - macos

Do anyone known how to revert my mistake? it is normal don't be allowed to save this file?
this is the file that I can't save it, please see line 21
I was use the developing mode in Odoo 10 when I editing product.template.product.form file with Formview option, when I miss < in my sentence and I saved. I made this syntax mistake in line 21 field name="x_season"/> sentence. After that I trying to reedit again and again, stop servers, start server, log in, log out, etc... but when I try to save I can't. Why ????
TypeError
**Odoo Client Error
TypeError: undefined is not an object (evaluating 'field.attrs.name')
http://localhost:8080/web/static/src/js/views/list_view.js:381

If you made a mistake modifying a view in the developer mode, you only have to restart the Odoo service updating the module which generated the views you modified. I guess in your case you have to update the views of the module product. To do that, in console:
python /your-odoo-path/odoo-bin -c /your-config-file-path/.odoo.conf -d your-database-name -u product
It will restore the XML code and remove the developer mode modifications in product module view.

Related

Unable to simply install and use datatable editor (laravel 9/npm)

I end up posting this message because I spent my entire day trying to get the datatable editor to work but without success.
I'm on a brand new install of laravel 9 that I haven't installed anything on. I just set up datatable on USER table and it's ok.
But when i want to use datatable editor (I bought the license today) i have this two error in the console :smile:
app-e6e82434.js:45 jQuery.Deferred exception: $.fn.dataTable.Editor is not a constructor TypeError: $.fn.dataTable.Editor is not a constructor
at HTMLDocument. (http://test88.test/users:67:75)
at Q (http://test88.test/build/assets/app-e6e82434.js:45:31424)
at ae (http://test88.test/build/assets/app-e6e82434.js:45:31749) undefined>
Uncaught TypeError: $.fn.dataTable.Editor is not a constructor
at HTMLDocument. (users:67:75)
at Q (app-e6e82434.js:45:31424)
at ae (app-e6e82434.js:45:31749)>
I installed datatable editor via npm then ran the script so that it puts the files in the right place as shown in the doc
but I have the impression that it does not take into account my files or that it considers that I do not have a license.
I installed the debug script but the link it sends me always gives a 404. The debug script crashes when I'm on the page that tries to display the table of users and when I'm on a classic page it shows me that everything is ok except that datatable editor is not loaded.
I think I've tried everything to load this damn script but I can't. Anyone have any idea what the problem is?
I try to make datatable editor running

Sulu, strange hash related error when trying to save page / post?

Until recently everything was working well. Now, when I try to save (create or update) any page or post I get error message at top of the form "Error - There was an error when trying to save the form".
In error log I see this error:
“Uncaught PHP Exception Sulu\Component\Rest\Exception\InvalidHashException: “The given hash for the entity of type “Sulu\Bundle\ArticleBundle\Document\ArticleDocument” with the id “9e0720a7-5565-4a6f-a735-8a186b8fef9b” does not match the current hash. The entity has probably been edited in the mean time.” at /var/www/html/vendor/sulu/sulu/src/Sulu/Component/Hash/RequestHashChecker.php line 53"
Tried clearing symfony cache, website cache from admin, restarting docker containers.
I'm totally unaware that I did something to cause this error. Please help.
Update: strange thing I just noticed. When I try to save some article and I get that error and go back to overview page (where i.e. all articles of that type are listed) then I see unchanged article title. But when I click to edit it I see changed title?!? Like title on overview page and title on edit page are not used from the same place? How is that possible?
Update:
Now even I setup once more project from scratch saving articles causes that error. Some more info:
In stack trace last command executed is:
in vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php (line 64)
an it shoots out “No alive nodes found in your cluster”.
And while I'm setting up the project when executing:
php bin/console ongr:es:index:create
I get error:
{"error":{"root_cause":[{"type":"resource_already_exists_exception","reason
":"index [su_articles/sWs5F1uzSFO8bFiZqF1Egw] already exists","index_uuid":
"sWs5F1uzSFO8bFiZqF1Egw","index":"su_articles"}],"type":"resource_already_e
xists_exception","reason":"index [su_articles/sWs5F1uzSFO8bFiZqF1Egw] alrea
dy exists","index_uuid":"sWs5F1uzSFO8bFiZqF1Egw","index":"su_articles"},"st
atus":400}
And when I run:
php bin/console ongr:es:index:create --manager=live
I get similar:
In Connection.php line 675:
{"error":{"root_cause":[{"type":"resource_already_exists_exception","reason":"index [su_articles_live/Pissm9ycRj-o79K4wrrD
AA] already exists","index_uuid":"Pissm9ycRj-o79K4wrrDAA","index":"su_articles_live"}],"type":"resource_already_exists_exc
eption","reason":"index [su_articles_live/Pissm9ycRj-o79K4wrrDAA] already exists","index_uuid":"Pissm9ycRj-o79K4wrrDAA","i
ndex":"su_articles_live"},"status":400}
Also to mention that now saving pages works, but saving articles doesn't.
This solved the issue on ElasticSearch index creation for me:
php bin/console ongr:es:index:drop --force
The error can happen in the following cases.
Expected Case somebody else did edit the same article like you and did save it
Unexpected Case your phpcr cache is not in sync
Unexpected Case you have a multi server setup but your cache.app is not configured to use a central cache
So if its one of the unexpected cases first you should clear your cache.pools with:
bin/console cache:pool:prune
If you have a multi server setup make sure you configure a central cache. Most use in this case a redis-server which you configure in your cache.yaml e.g.:
# config/packages/prod/cache.yaml
framework:
cache:
default_redis_provider: "%env(resolve:REDIS_DSN)%"
app: cache.adapter.redis
Also make sure that you use the latest version and maybe update your phpcr cache configuration based on the sulu/skeleton: https://github.com/sulu/skeleton/blob/2.x/config/packages/prod/sulu_document_manager.yaml, there you could when performance doesn't matter in your case disable the phpcr cache, I would not recommend that.

Fatal error: Class 'Mage_Sales_Model_Order' not found in ....core/Mage/Reports/Model/Resource/Order/Collection.php on line 456

I was installing magento 1.9.1 on my server everything went fine but after installation when i click on Go to Backend and give my username and password to login to Admin Panel it gives the following error:
Fatal error: Class 'Mage_Sales_Model_Order' not found in
/home2/siatel/public_html/4ebay/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php
on line 456
Though my frontend side of website is working perfectly ... Please help.
I can see my admin log-in page. Error comes only when I give username and pass and hit continue...
Without more information, it sounds like you're missing your
app/code/core/Mage/Sales/Model/Order.php
file. It seems like you're missing a lot of different files as well. I'd diff your installation vs. the contents of a standard tar archive.
Your error shows like this
Fatal error: Class 'Mage_Shipping_Helper_Data' not found in
/home2/siatel/public_html/4ebay/app/Mage.php on line 547
see the portion 'Mage_Shipping_Helper_Data' not found. It means Magento is looking for a helper class file and it couldnt find it. Magento will look for this file in app/code/core/Mage/Shipping/Helper/Data.php.
I will give you some hint on how this file path came from. First of all magento core files lies in the location app/code/core/. Then missing class name (in this case Mage_Shipping_Helper_Data) will converted as Mage/Shipping/Helper/Data.php. Then this will append to the core codePool directory path. That is app/code/core/Mage/Shipping/Helper/Data.php
For every file, magento assigns path as like this. Please note that, you need to attach .php part to the last keyword. Also you need to copy the exact same data of that file (take into consider the version). It means it need to have a 'Magento way' class name and so on

Magento, what could cause $model->load($id) to fail?

I wrote a module for magento, and tested in my localhost. It was working like a charm.
But after uploading to a server, when I try to load a product with the following code:
$product = Mage::getModel('catalog/product')->load($id);
the code execution stops. No exception.log generated. no output to browser.
By outputing to system.log i was able to verify a correct id was being used, and there is a product with that id in the store.
this load method is used by the default catalog/product controllers and works, but its not working in my module.
edit:
I've debbuged and got it to output something to system.log.
2013-09-02T20:49:33+00:00 ERR (3): Recoverable Error: Argument 3 passed to Mage_Eav_Model_Entity_Abstract::_canUpdateAttribute() must be an array, null given, called in /home/next/public_html/app/code/core/Mage/Catalog/Model/Resource/Abstract.php on line 545 and defined in /home/next/public_html/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1254
2013-09-02T20:49:33+00:00 ERR (3): Warning: array_key_exists() [<a href='function.array-key-exists'>function.array-key-exists</a>]: The second argument should be either an array or an object in /home/next/public_html/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1256
I dont think that was originated in my module, since i uploaded it to a clean store and it was working like it should. That store has almost 15 modules installed and one of them is probably overriding something that shouldn't, or maybe the store owner changed something in original magento source code.
I recommended to disable module by module so he can discover what module is causing the problem and revert all possible changes in original source code, but i'm not sure if the store owner will be able to do that.
Isnt there any way i can test current magento installation to be sure my module will work with no conflict with other pre-installed modules??
PHP almost never "just stops" without producing an error. Temporarily edit index.php such that
ini_set('display_errors', 1);
and (or set the MAGE_IS_DEVELOPER_MODE flag to true in your web server)
if (true || isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
Mage::setIsDeveloperMode(true);
}
Additionally, check your php error log for any error produced when you run your code.

I can't enable or disable modules. I'm getting "An error occurred while saving this configuration"

I have a new fairly fresh install of Magento 1.7.0.2. I installed two custom payment method modules that are working fine. But now whenever I try to disable or enable any Payment Method or Shipping Method it gives me an error like this:
An error occurred while saving this configuration: Warning:
preg_match() expects parameter 2 to be string, array given in
/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Encrypted.php
on line 57
Do you have any idea why?
EDIT 2:
I found the problem. It was caused by a patch I applied to fix to a previous BUG. :P
EDIT:
So I disabled all custom modules and I was still getting the same error. I logged what was happening and it seems that some core modules are sending an array to be saved.
Like PayPal Express Checkout for instance. One of the config options is the Time of Day in the SFTP credentials for Settlement Report Settings. It's composed by three different drop-downs and it's sending an array to be saved!
In the Shipping Methods, UPS has a config options called Allowed Methods, and it's also sending an array!
I still don't know why it wasn't happening before and now it is. They shouldn't be encrypting everything. Any clues?
I had the same issue, its a known bug, try this around line no. 135 on code/core/mage/Adminhtml/model/config/data.php
// add this code
$backendClass=false;
if (isset($fieldConfig->backend_model)) {
$backendClass = $fieldConfig->backend_model;
} // before this
if (!$backendClass) {
$backendClass = 'core/config_data';
}
This actually is a reported bug in Magento that seems to affect encrypted config settings (passwords, API keys, etc.).
http://www.magentocommerce.com/bug-tracking/issue?issue=14217
Try disabling the first of the modules, log out of the admin panel, clear /var/cache and see if the problem still exists. If it does, do the same with the second module.
The problem should be gone. Now that you know which module causes the problems you can either decide to try another module instead or debug to see whats going wrong.
Put a breakpoint on line 57 in /app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Encrypted.php to see what goes wrong. It seems that the second parameter is not a string (might be null for example due to wrong configuration or something) when its given to the preg_match function. Maybe this helps you to identify the problem.
Regards
Disabling modules through the back office isn't a good idea as it only disables the block output, if you would like to disable a module you should go to app/etc/modulesand there you should find Module_Name.xmlfile - in this file just put false in active node.

Resources