Friday, December 4, 2015

Messages menu options grayed out on OS X

If you're someone that manages your fonts more than a normal user, you may have run into this issue with the built-in Messages, or iMessage, app on OS X. My users couldn't sign in or access any of the app features. The reason behind it was really simple. The AppleGothic font that normally comes on the system is required for the Messages app to work correctly. Make sure you have it activated if you're using a font manager, such as Universal Type Client. Once you have it active, open Messages and you should be able to use it like you would've expected.

Credit: https://discussions.apple.com/thread/6037163?tstart=0

Wednesday, October 7, 2015

Terminal server user cannot set default printer

Ok, I'll admit that this post is late to the party because I'm talking about Server 2003, which went EOL earlier this year. However, I'd guess that there are others like me that haven't eliminated it from their environment completely, and something similar may show up in the newer server OS versions, so here goes.

I had a couple of users who reported issues printing from their terminal server sessions. Printers were showing as installed, but if they tried to print from an application, say Excel, it would give them an error that no printers were installed and they couldn't select anything. Looking into it further, the printers were there but none were set to the default printer, and you could not manually set the default printer. Without a printer set, the applications were getting confused.

I tried recreating the roaming profiles to no avail. The printers themselves worked fine for other users and were setup locally on the terminal server. I found a Microsoft article about something similar with redirected printers that said to copy of the Default Users folder with a clean copy from another server, but that didn't seem to help either. Then I found this article. The registry hack listed there fixed it for the users that were having trouble.

Since I had regedit disabled for non-admins, I had to make changes from within a session opened by an admin. That made it a little trickier to find the correct reg key for the current user, but not impossible. What I did is expand HKEY_USERS and took a look at all the entries. Then I had the user who was having trouble login, then refreshed HKEY_USERS. Then had them logout and refreshed HKEY_USERS. It might help to do a before and after screenshot. Doing that you should be able to figure out which of the keys belong to their user account because it'll appear and disappear depending on when that user is logged in or out, and that's where you'll want to add the fix.

Have the users login, then from a session that has access to modifying the registry go to HKEY_USERS\*guid*\Software\Microsoft\Windows NT\CurrentVersion. Look for a key named Windows. If it doesn't exist, create it. Then, within Windows, create a new String value named Devices. Set the value of Devices to "winspool,Ne00", without quotes. Once done, have the user log out, then back in to your terminal server. He/She should be able to set the default printer and once again access printing services.

Monday, April 13, 2015

Export a list of categories and their parent from Magento

We were looking for a way to create a product setup form for our Magento-based eCommerce site. One of the hangups was getting a list of all our categories so that we could create a dropdown for users to select the category name from, but that we could pull the category ID from then as well. There are some posts that I found which tell you how to export all the categories with the ID value, but I didn't see anything that also told you how to get the parent category info so I had to dig into it myself. Luckily it wasn't too difficult so if you're looking to do something similar or just need a list of your category tree, you're in luck. There may be a way to do this in PHP using the some built-in functions of Magento, but I'm not familiar enough with them so I had to turn directly to MySQL. If you have an easier way please leave a comment to let everyone else know.

If you're looking at this then I'm going to guess you're a developer, or at least know someone who is that has access to the database running your site and can help you. If not then I wouldn't suggest doing this without some assistance unless it's on a test site or something other than your live site.

Within the Magento database there are two tables we need to join to get the information we're after: catalog_category_entity and catalog_category_entity_varchar. The entity table has the id values and the varchar table has the name. Now, there is a magic number used in the query that seems to vary database to database. That value is the attribute_id from the catalog_category_entity_varchar table. What I did to find out what value to use is look at the contents of the table and pay attention to the attribute_id value given to the Root Catalog entry that should be first. In my case it was 33 on one site, and 35 on another, which is why I say it varies. However, that attribute_id appears to identify the primary value field we want in order to get the correct category name, so mark it down.

The query I used to create my category list for the site where I found the attribute_id value to be 33 looked like this:

SELECT cc.entity_id,cv.value,cc.parent_id,cc.path FROM dbname.catalog_category_entity cc INNER JOIN dbname.catalog_category_entity_varchar cv ON cc.entity_id=cv.entity_id WHERE cv.attribute_id=33;

Make sure to change the attribute_id=XX; at the end to match whatever attribute_id value you found it to be within your own database. You also need to substitute your own database name in for dbname, but I'm hoping that you already knew that if you have access to the site's MySQL backend.

In this the entity_id is the ID of the category, value is the name of the category, parent_id is the ID of the parent category directly above in the hierarchy, and path is the full path in the hierarchy tree to the category based on the ID values.

I ran this query and had it export to a CSV file, and from that was able to build a drop down list to be used for selecting categories. Then we'll take products that get input into our form and upload them to the site through the use of Magmi. Hopefully this has been useful and helps you figure out whatever you're attempting to do with the categories on your Magento site.