Can’t update cusom file attributes of 4% of files in document library

We use Sharepoint Online. Created document library, synced to a local folder for initial file upload. Uploaded ~20k files. Created 3 custom fields (2 single value taxonomy, 1 multi value taxonomy). We manually set values for top level folders. And we needed to propagate same values for all files and folder under top ones.

Wrote node.js app which reads attributes from folder on top level, then writes same attributes to all nested files. All working fine, taxonomy fields got updated, even multi selection taxonomy. However these took a while to research in internet. All updates went without errors, except for few checked out files.

But we noticed, that approx 800 files and folders got updated partially. Some had only field3 updated, some field2 and field3, completely random. (However i shall say only 2 files didnt have their multi-taxonomy field updated.)

There is some pattern though – typically in one folder i see list of files and i see that custom field #1 missing , others two – properly set. In another folder i see field#1 and field#3 properly updated for most of files, but field#2 is empty.

I thought I missed some error and run the process again. Nothing changed. I tried to update one of those files via REST API – nothing happening. All is OK from API point of view, but fields not getting updated. When i read data back – its same as before update.

So now i stuck with 800 listitems@driveitems which refuse to be updated via REST API. How come? I can update fields manually from web ui, but any time i try to update them via REST API – it is just not updating. At same time i can easily update field values of files sitting next to those. Permissions look the same.

This is very weird behaviour. How can i fix this?

Here is how I prepare POST body for fields#1 and #2

                    body['Region'] = {                         "__metadata": {                             "type": "SP.Taxonomy.TaxonomyFieldValue"                         },                         "TermGuid": parentAttr.Region.TermGuid,                         "WssId": "-1"                     };  

Different schema for multi select taxonomy fields. I just keep comma separated guids and then create string like -1;#|;-1;#|;

body['md59817bf38f4370830b89bac6aa4e79'] = parentAttr.CommaSepGuids   .split(",").map(p => `-1;#|$  {p};`).join("");  

then here is i setup request headers

            o.headers["X-HTTP-Method"] = "MERGE";             o.headers["IF-MATCH"] = "*";             o.headers["Content-Length"] = o.body.length; 

Magento 1.9.4.1, saving product attributes values lost/messed up

I have a catalog drop-down attribute, within that attribute there are about 70 options defined. Every time after saving that specific attribute, one of the options loses its display-value for each store, and the position-value is always set to 0 (zero). The Admin-value is not affected. Only the display-values for each store.

Best practise to design API for multiple printer attributes?

I have network printers which have different attributes (e.g. supported network protocols, languages, status, print modes).

public abstract class PrinterAttribute {   protected PrinterAttribute(int value, string dsc)   {     this.Value = value;     this.Dsc = dsc;   }   protected PrinterAttribute(int value, string dsc, Enum type) : this(value, dsc)   {     this.Type = type;   }   protected int Value { get; private set; }   protected string Dsc { get; private set; }   protected Enum Type { get; private set; } } 

And finally I will have number of classes like NetworkProtocol, PrinterMode.

NetworkProtocol constructors:

public class NetworkProtocol : PrinterAttribute {   public NetworkProtocol(int value, string dsc) : base(value, dsc) {}   public NetworkProtocol(int value, string dsc, ProtocolType protocolType) : base(value, dsc, protocolType) {} ... 

1. way – get desired network protocol from locating it in all possible ones

// all possible network protocols that a printer can support private static IList<NetworkProtocol> allPossibleProtocols; public static IList<NetworkProtocol> AllPossibleProtocols {   get   {     if(allPossibleProtocols == null)     {       allPossibleProtocols = new List<NetworkProtocol>()       {         new NetworkProtocol(0, "None"),         new NetworkProtocol(1, "FTP"),         new NetworkProtocol(2, "LPD"),         new NetworkProtocol(4, "TCP"),         new NetworkProtocol(8, "UDP"),         new NetworkProtocol(0x10, "HTTP"),         new NetworkProtocol(0x20, "SMTP"),         new NetworkProtocol(0x40, "POP3"),         new NetworkProtocol(0x80, "SNMP"),         new NetworkProtocol(0x100, "Telnet"),         new NetworkProtocol(0x200, "Weblink"),         new NetworkProtocol(0x400, "TLS"),         new NetworkProtocol(0x800, "HTTPS")       };     }     return allPossibleProtocols;   } }  public static NetworkProtocol POP3 {   get   {     // don't like it because you locate it by value     return AllPossibleProtocols.Single(x => x.Value == 0x80);   } } 

2. way – create public static NetworkProtocol for every possible protocol

private static NetworkProtocol smtp; public static NetworkProtocol SMTP {   get   {     if( smtp == null)     {       smtp = new NetworkProtocol(0x80, "SNMP");     }     return smtp;   } } 

3. way – create enum and find it by enum

public enum ProtocolType : int {   None,   FTP,   LPD,   TCP,   UDP,   HTTP,   SMTP,   POP3,   SNMP,   Telnet,   Weblink,   TLS,   HTTPS }  private static IList<NetworkProtocol> allPossibleProtocols3; protected static IList<NetworkProtocol> AllPossibleProtocols3 {   get   {     if (allPossibleProtocols3 == null)     {       allPossibleProtocols3 = new List<NetworkProtocol>()       {         new NetworkProtocol(0,    "None", ProtocolType.None),         new NetworkProtocol(1,    "FTP", ProtocolType.FTP),         new NetworkProtocol(2,    "LPD", ProtocolType.LPD),         new NetworkProtocol(4,    "TCP", ProtocolType.TCP),         new NetworkProtocol(8,    "UDP", ProtocolType.UDP),         new NetworkProtocol(0x10, "HTTP", ProtocolType.HTTP),         new NetworkProtocol(0x20, "SMTP", ProtocolType.SMTP),         new NetworkProtocol(0x40, "POP3", ProtocolType.POP3),         new NetworkProtocol(0x80, "SNMP", ProtocolType.SMTP),         new NetworkProtocol(0x100, "Telnet", ProtocolType.Telnet),         new NetworkProtocol(0x200, "Weblink", ProtocolType.Weblink),         new NetworkProtocol(0x400, "TLS", ProtocolType.Telnet),         new NetworkProtocol(0x800, "HTTPS", ProtocolType.HTTPS)       };     }     return allPossibleProtocols3;   } }  public static NetworkProtocol GetProtocol(ProtocolType protocolType) {   return AllPossibleProtocols3.SingleOrDefault(x => x.Type.CompareTo(protocolType) == 0); } 

Windows Data Protection API – Machine Attributes

We’re using DPAPIProtectedConfigurationProvider \ Windows Data Protection API (DPAPI) to encrypt an application config file and have an issue where the file becomes unreadable.

We are using the UseMachineProtection property so that the config file cannot be used across multiple machines but are wondering, what attributes of the machine is this config file encrypted against? For example, if the MAC address of the machine changes, will the machine no longer be valid?

Algorithms for constrained clustering on attributed graphs with some cluster-level constraints on their attributes

I posted this on stack overflow yesterday and was told here might be a better fit, so here we go.

I have a graph with 240k nodes and 550k edges with five attributes per node coming out of an autoencoder from a sparse dataset. I’m looking to partition the graph into n clusters, such that intra-partition attribute similarity is maximized, the partitions are connected, and the sum of one of the attributes doesn’t exceed a threshold for any given cluster.

I’ve tried poking around with an autoencoder/deep clusterer but had issues making a loss function that would take into account connectivity constraints. I’ve also looked at heirarchical clustering with connectivity constraints but can’t find a way to enforce my sum constraint optimally. Same issue with community detection algorithms on graphs like Louvain.

If anyone knows of any approaches to solving this I’d love to hear it, ideally something implemented in Python already but I can probably implement whatever algorithm I need should it not be. Thanks!

Create import entity for attributes

I’m trying to implement a new import entity to be made available through the ImportExport module (which is actually extended by Firegento_FastSimpleImport2, but that’s not relevant for this question) for importing a collection of attributes (just the labels not the values) which will be used for product attributes, but might be needed to be extended in the future for customers or categories. I manged to do a new import entity and make it available through the import interface.

My question now is if there’s a recommended way to use Magento’s API for attributes (maybe from the EAV module) or I just make a pseudo entity and import directly in the attributes tables?

The module install / update scripts are a no-go for this because it needs to be further integrated and withing a larger system and work seamlessly via API or CLI commands, repeatedly.

I’ve seen only one example of programmatically adding attributes without install/upgrade scripts here but I don’t know how I can reuse it in implementing the ImportExport module’s AbstractEntity. Any pointers would be helpful.

How to export all attributes ad its options to Maganto 2 store by using magento 2 connector with Akeneo PIM?

in PIM akeneo dasboard, after exporting products with all attributes and its options, Magento 2 store is not receiving all the attributes options. I have already set all the setting:
1)in PIM akeneo dashboard —–> setting —–> Create Attribute —-> any option(Simple Select) [Also added all the required data with all options]
2) Added attribute in current families
3)In magento 2 connector —–> setup attribute mapping —-> added attribute for magento 2 and its corresponding field in akeneo
4) finally updated product with attribute and choosing required options

Expected : Magento 2 store will receive the product with all attributes and chosen options

Reality: Magento 2 store received only few field, but custom attributes are not showing the option enabled in PIM akeneo products

How to solve this issue?

How To Change Slugs of Pages and WooCommerce Attributes?

Hi,

I'm having an issue with the slugs of a website I built on WordPress and WooCommerce.

I'm trying to change the slugs of some pages, but they keep going back to ending with (-2) in the slug.

I think I might be because I'm also using those names as Product Attributes in WooCommerce. I tried changing the slugs of the products to end with something unique, to see if that will allow me to change the slug of the pages correctly. However, the pages slugs still won't get changed and they get…

How To Change Slugs of Pages and WooCommerce Attributes?