When using the gis.content.clone_items command in the API we consistently see the error below when running it on a webmap in ArcGIS Online containing a hosted view layer. with parameters set to:
"(copy_data=True, search_existing_items=False)"
Traceback (most recent call last):
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\_impl\common\_clone.py", line 3404, in clone
and "viewLayerDefinition" in layer["adminLayerInfo"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
The same command works perfectly on version 2.3.0 of the API, the clone completes and it clones both the webmap and hosted view layer correctly, so this seems like a new bug introduced in the API