Ibn al-Mubārak’s words “But there is no disagreement concerning charity” separate two inquiries. The quoted report has a break between al-Ḥajjāj b. Dīnār and the Prophet ﷺ, while other evidence establishes benefit from charity given for the deceased. Al-Nawawī presents this benefit as agreed upon and explicitly rejects an exceptional opinion, reported by al-Māwardī, that the deceased can receive no posthumous benefit at all.
Prayer and fasting: in the general case, al-Shāfiʿī and the majority hold that the reward of prayer or fasting performed by another does not reach the deceased. If, however, the deceased owed an obligatory fast and a guardian or someone the guardian authorizes performs it, al-Shāfiʿī has two reported views: the more widely transmitted one denies validity, while later Shāfiʿī investigators consider the view permitting it stronger. This is distinct from voluntary fasting.
Qurʾān recitation: the well-known Shāfiʿī position is that its reward does not reach the deceased; some Shāfiʿī scholars disagree. Other groups extend the benefit to all devotional acts, including prayer, fasting and recitation, by analogy with supplication, charity and pilgrimage. Al-Nawawī rejects this unrestricted analogy as weak.
The restrictive argument invokes “A person shall have only what he strives for” (Qurʾān 53:39) and “When the child of Adam dies, his deeds cease except for three”; counterarguments appeal to the specific transmitted allowances concerning charity, supplication and pilgrimage. A legal view may rest on independent evidence, but none of these arguments repairs the disconnected isnād under discussion.