How to detect unpublished content in Joomla db? - joomla

I'll probably must create import script from Joomla.
How I can detect that selected content is not published?
I see three columns in jos_content table:
publish_up
publish_down
published
I need to be sure what these columns means, to know which content is published or not.
E.g. content item:
publish_up 2008-07-09 11:17:43
publish_down 2008-10-16 00:00:00
published 2008-07-09 11:17:43
is publishes or not?
I can't check in by myself in administration panel because something is broken in the website right know, so db is the only option for me now.

You have to look for 'state' values in the #_content table.
According to https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/forms/article.xml, state values are:
0 = unpublished
1 = published
2 = archived
-2 = trashed / marked for deletion
You also need to check the publish_up and publish_down dates.

'state' values can be: -1 = archived
Not right..
2 = archived
(Joomla 3.3.6)

Related

In Microsoft Dynamics CRM, how do I get the meaning of an attributemask value?

I have no background in Microsoft Dynamics CRM and the company I'm at lost their one developer who was maintaining this system. There is a function app with some code I'm trying to understand. The intent of the code appears to be to determine the user who set a price discount to then either permit it or not. It gets the audit entities associated with the salesorder that contain a 115 in the CSV AttributeMask.
List<Audit> audit = myServiceContext.AuditSet.Where(a => a.ObjectId.Id == x.Id)
.ToList();
audit = audit.Where(a => a.AttributeMask.Split(',').ToList().Contains("115"))
.ToList();
I believe this 115 must represent the discount field, but I want to know where the past developer found this value.
I've found suggestions online for how to get these AttributeMask values with a name, like this one, from the stringmap table. I used XrmToolBox's FetchXML Builder to dump the entire table but it only goes from 0 through 113. Some suggest looking in MetadataSchema tables, but I can't find those tables, and saw suggestions that those are only available for on-premises CRM.
Where can I find the meaning of 115 and/or how did a past developer decide to use this value?
The code queries the Audit table and selects the audit rows for the record identified by objectid. (This is the first line.) As you can read on MS Docs column audit.attributemetadata contains a CSV of the ColumnNumber metadata property of attributes.
In the second line the audit rows are filtered down to those containing updates to column 115 of the table the targeted record belongs to. You can lookup the name and other properties of this column by retrieving the entity metadata for the table. The EntityMetadata object has an array of AttributeMetadata. In this array you can find the desired attribute by searching its column number in property ColumnNumber. More information can be found on MS Docs - AttributeMetadata.ColumnNumber Property.

Magento reports empty rows

When I'm generating a report of the most viewed products there are a lot of empty rows. So from some day's I cant get any data of the most viewed products. There is reasonable traffic on the site and I know for sure that every day products are viewed.
It is a Magento 1.6 webshops. Other reports are working correctly.
Does anyone know what the problem could be?
The issue is most likely coming from the DB which is used to generate this report.
Browse the table generating reports for Most Viewed Product and if you find “store_id” empty, edit and select the correct store_id for your store.
I run the following query to update all order items:
UPDATE table_name SET store_id=1 WHERE store_id =null;
This is assuming you only have 1 store and its store id = 1.
Also, take backup before running.

Globally set Qty Uses Decimals magento

Is there a way to globally set the "QtyUsesDecimals" option in magento? My
I'm setting up a Magento site for a client who sells Fabric and other related materials. There is a minimum of .5 yards for any one Fabric product, After that, it can go to any amount, but the minimum is .5. Currently I'm able to type in .25, .125, etc. and add those to the shopping cart.
I only want this to apply to the Fabric products (there are around 2000 different fabric products) but not to the other types she sells on her site, like Rulers, needles, buttons, etc... I don't want people to be able to purchase .5 buttons.
Thanks
I was wondering the same thing, and I just googled this for you and in exactly 5 seconds.. I got the answer (and comprehended it too, mind you):
https://magento.stackexchange.com/questions/6193/magento-product-quantity-uses-decimals
And to apply this to just fabrics.. it should be something like this:
UPDATE `cataloginventory_stock_item`
SET `is_qty_decimal` = 1
WHERE `product_id` IN (
-- INSERT SUBQUERY HERE THAT GETS ALL PRODUCT ID's UNDER THE 'FABRIC' CATEGORY --
-- IT WOULD START WITH 'SELECT `product_id` FROM ..' you do the rest I believe in you --
);
For new/incoming products.. No, there isn't a global config that controls this, and no you can't set it in Default Configuration as it is already a global attribute. Unless, you are willing to invest some time into making an Observer module that sets that attribute for all new products that are created -and- saved (successfully).
There is a database query to solve this issue if the not fabrics products are just a few, or none.
This solution is not update safe and shouldn't be used unless you really understand what you're doing.
ALTER TABLE `cataloginventory_stock_item`
CHANGE COLUMN `is_qty_decimal` `is_qty_decimal` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '1' COMMENT 'Is Qty Decimal';
This will change just the default value of this column from DEFAULT '0' to DEFAULT '1'. In Magento 1.7.0.2 the other column fields are untouched, so you can check the query to see if your database version corresponds. Then you should check and rerun this query on each database update.
After executing this query you should modify the value back to '0' to the non fabrics products: you can do all at once via query (check Seth Jeremi Malaki's answer) or through the Admin interface (product->stock) one by one (the secure way).
Otherwise, if the fabric products are a lot less (or none), just keep the database at its state and modify only the fabrics via the admin interface.

Why are my products description updated in each stores?

I'm using Magento 1.4.0.1, when I select a product in a store scope (let's say FR store) and update the short description, that short description is being updated in all others store but not in global scope.
I took a look at the DELETE/INSERT statement and here is what I got:
DELETE FROM `catalog_product_entity_text` WHERE (entity_id='61060' AND entity_type_id='4' AND attribute_id IN('72') AND store_id ='1')
The DELETE statement looks correct, it deletes an attribute only from the store id 1
INSERT INTO `catalog_product_entity_text` (`entity_type_id`, `attribute_id`, `store_id`, `entity_id`, `value`) VALUES ('4','62','2','61060','FR'), ('4','62','1','61060','FR'), ('4','62','4','61060','FR'), ('4','62','3','61060','FR') ON DUPLICATE KEY UPDATE `value`=VALUES(`value`)
However, the attribute 62 (short_description) gets updated on each store, however, I'm currently updating it on the FR (store id 1) scope in the back office.
With another database I've (an oldest one) I can't reproduce this behavior, since the code remains the same, I suspect a database config, but I can't find it.
Do you guys have any ideas? I'm a bit stuck and going crazy here.
Here are some screenshot from the backoffice:
As you can see I choosed the FR store, updated the short description, and get the INSERT statement above, the stores DE & Test are updated as well.
Your screenshot shows, that currently [WEBSITE] scope is assigned to your short_description attribute, where you expect it to be [STORE VIEW].
That's why it's updated for all stores in website scope.
Check/change the attribute settings in:
Catalog -> Attributes -> Manage Attributes -> short_description -> Scope

Magento: Can you set it so all Websites share the same order increment id sequence?

Does anyone know if it is possible to make it so all websites or stores share the same order increment ID. Basically we are working with an ERP system that is allowing us to submit our Invoice number to be the actual order number in the system, the thing is though, they only need one number sequence not a different one for each store like how Magento does by default.
I've just found this out and it is pleasantly easy. You could put the following in an upgrade script...
Mage::getModel('eav/entity_type')
->loadByCode('order')
->setIncrementPerStore(false)
->save();
P.S. I've been receiving requests to make an extension of this but one already exists: Custom Order Number Pro. It's commercial but it has a decent sounding list of features.
You can change it directly in the database. See table eav_entity_type and column increment_per_store (change this to 0).
Another numbering information is stored in eav_entity_store
You can change it directly in the database. See table eav_entity_type and column increment_per_store (change this to 0).
Another numbering information is stored in eav_entity_store
Unfortunately this doesn't work if you use Sisow and iDeal payments. The orders aren't sent to client nor admin. I had to undo the changes. Now it's back to working order but still no working solution for continuous order numbers in multi-store config.
Br,
Steve
You can change it directly in the database. See table sales_sequence_meta => column sequence_table and change reference of 'order' in 'entity_type' to same table like sequence_order_0.
Ex: Default Table
meta_id entity_type store_id sequence_table
5 order 1 sequence_order_1
6 order 2 sequence_order_2
7 order 3 sequence_order_3
8 order 4 sequence_order_4
Change To
5 order 1 sequence_order_0
6 order 2 sequence_order_0
7 order 3 sequence_order_0
8 order 4 sequence_order_0
This may help you.

Resources