[13:26:15] Sorry if this is a /very/ nooby question, but is there a way to prepend an item to an array of phutil_tags? I'm trying to add in an XLS tag into https://we.phorge.it/source/phorge/browse/master/src/applications/phame/controller/blog/PhameBlogFeedController.php and I've tried using array_unshift($content, my tag here), but I get an error about $content not being an array [13:26:45] when it's kinda declared as that? I tried googling and this seemingly is the best result i got: https://laracasts.com/discuss/channels/laravel/array-push-expects-parameter-1-to-be-array-object-given [13:29:23] Based on my understanding from this blog post (https://darekkay.com/blog/rss-styling/) the tag needs to go before the tag [13:32:28] catbarf: I suspect there may be an issue outside of what you describe. The laracasts post is about a codebase where somethign is not actually an array but a custom class that acts like a list of things ("Collection"). If that happens, then the answer is to look at the documentation for that class and look for a way to add/prepend/insert something where you need it with the methods of that class. [13:32:38] However, here `$content = array();` [13:33:10] if it is not an array for you, then that means there is likely a typo in the code or maybe other steps have happened in-between that replace the variable. [13:33:15] yeah that's why I was confused [13:33:50] are you modifying that PHP file directly, or are you working from a hook/event callback or a subclass? [13:34:07] I'm mucking about directly [13:34:17] around which line number? [13:34:30] ~92 [13:34:34] after line 88, $content is no longer an array [13:34:43] Right after the feed tag is set up [13:35:18] that might be why it was giving me 2 different errors depending on where i placed my insert [13:35:39] If you need it to be a first child of , then insert before that line indeed. [13:35:56] If you need it to be a sibling before , then you'll need to look at AphrontFileResponse and setContent for how to get a second element in there [13:36:03] Will do [13:36:05] Appreciate the help [13:37:39] https://secure.phabricator.com/book/phabcontrib/article/rendering_html/ [13:38:22] It looks like you could use `$content = hsprintf('%s%s', $your tag, $content);` to builld a combined object of two siblings [13:38:51] where hsprintf just takes two strings basically and but re-wraps as PhutilSafeHTML to keep the type and security promise [13:40:44] Let me test that, thank you [13:41:23] https://we.phorge.it/book/contrib/article/rendering_html/ :) [13:43:52] Well it "worked" but it didn't work, making it a me problem. [13:43:57] https://michaeleisemann.com/phame/blog/feed/1/ [13:44:04] Thanks for your help, everyone :D [13:44:42] armed with this knowledge I am ready enough to be dangerous [13:46:24] Not bad [13:47:32] I think the only thing you need is to send the most appropriate HTTP Header for XML [13:48:04] Premising that it seems already as the correct Content-type application/xml uhm [13:49:23] I didn't do everything that the blog post said to do, so I'm going to follow the instructions [13:49:42] Ah, interestingly your XML is perfectly validated but it seems it delivers an .xsl file that renders it in weird ways on browser webs [13:51:59] I wonder if it's the way I'm hosting the stylesheet [13:52:15] I just dragged and dropped it, set it to public and then plunked that URL in [13:55:52] It seems it's downloaded as SVG file [14:02:33] Yeah looking at the object in files: https://michaeleisemann.com/F983 it says the mime is image/svg+xml [14:04:59] If you are really desperate you can enter in your database and lookup the table file in database `phabricator_file [14:05:16] The column is called mimeType [14:05:55] It seems there is a CLI script to do that [14:07:40] ./bin/files encode F983 --as 'something' [14:08:10] I think that only changes the way it is stored on disk? [14:08:32] Available formats: aes-256-cbc, rot13, raw. [14:08:41] s/disk/storage provider [14:08:45] Yeah you are surely right, so I suggest to change the database [14:08:52] Yeah I'll go spelunking [14:09:32] UPDATE phabricator_file.file SET mimeType = 'something WHERE id = 983; [14:10:02] 'something' * [14:14:41] There's probably something more wrong with things than I thought, but that did not break the whole thing [14:14:44] so that's good [14:15:23] But I appreciate you working with me [14:15:51] Yeah I like people hammering on Phorge [14:16:33] I can't wait to see the next changelog landing on Wikimedia Phab https://we.phorge.it/w/changelog/2023.17/ [14:17:08] Maybe if I do figure this out, I can build a proper way to embed a stylesheet, like in the Edit Blog Page: https://i.imgur.com/9PUWHp0.png [14:17:17] I'm just been running the latest git HEAD