Skip to content

Commit 4ecfdd7

Browse files
committed
Support rendering regardless of entity type
1 parent 2049497 commit 4ecfdd7

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

BbCode/TagRenderer.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,7 @@ private static function getEntityId($entity)
4747
//\XF::logError('Can not get post/resource id: $entity is not defined.');
4848
return 0;
4949
}
50-
if ($entity instanceof \XF\Entity\Post)
51-
return $entity->post_id;
52-
if ($entity instanceof \XF\Entity\ConversationMessage)
53-
return $entity->message_id;
54-
if (class_exists('\XFRM\Entity\ResourceUpdate')
55-
&& $entity instanceof \XFRM\Entity\ResourceUpdate)
56-
return $entity->resource_id;
57-
\XF::logError('Can not get post/resource id: unsupported entity type.');
58-
return 0;
50+
return $entity->getEntityId();
5951
}
6052

6153
private static function getNumByDepth($depth, $override = -1)

addon.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"legacy_addon_id": "",
33
"title": "[Inforge] PostTOC",
44
"description": "Add BBCode to support the creation of a table of contents in posts.",
5-
"version_id": 1000070,
6-
"version_string": "1.0.0",
5+
"version_id": 1000170,
6+
"version_string": "1.0.1",
77
"dev": "Inforge",
88
"dev_url": "https://www.inforge.net",
99
"faq_url": "https://github.com/InforgeNet/PostTOC/wiki/Frequently-Asked-Questions",

build.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44
],
55
"minify": [
66
"js/inforge/posttoc/toc-renderer.js"
7+
],
8+
"exec": [
9+
"mv _build/upload/src/addons/Inforge/PostTOC/README.md _build/",
10+
"mv _build/upload/src/addons/Inforge/PostTOC/CONTRIBUTING.md _build/",
11+
"mv _build/upload/src/addons/Inforge/PostTOC/LICENSE _build/"
712
]
813
}

0 commit comments

Comments
 (0)